Chapter 4. Exploring the Loader
In the previous chapter we familiarized ourselves with the simplest and high level, Android-specific, asynchronous construct; the android.os.AsyncTask
. The AsyncTask
is a lean construct used to create background work that offers a simple interface to publish results and send progress to the main thread. In this chapter we are going to move our focus to android.content.Loader
, a high level Android-specific pattern used to load content asynchronously from content providers or data sources over a worker thread with content change capabilities and component lifecycle awareness.
In this chapter we will cover the the following topics:
- Introducing loaders
- Loader API
- Loader lifecycle
- Loading data with Loader
- Building responsive apps with AsyncTaskLoader
- Building responsive apps with CursorLoader
- Combining loaders
- Applications of loaders