7. Loaders

Many of an Android application’s tasks are not performed on the main thread, but asynchronously on a separate thread. This increases the application’s user interface (UI) performance. Loaders, too, asynchronously load data and monitor the underlying data source for changes. In this chapter, you will learn about loaders—particularly, CursorLoader. You will use CursorLoader to access information in the Contacts content provider. Finally, you will learn to create your own custom content provider.

Recipe: Understanding Loaders

As the name suggests, loaders are used to load data asynchronously. They are accessible in an activity and a fragment through the LoaderManager. The LoaderManager handles the life cycle of loaders and the underlying ...

Get The Android™ Tablet Developer’s Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.