Summary

The Loader framework in Android does a wonderful job of making it easy to load data in the background and deliver it to the main thread when it is ready.

In this chapter we learned about the essential characteristics of all Loaders—background loading, caching of loaded data, and a managed lifecycle.

We took a detailed look at AsyncTaskLoader as a means to perform arbitrary background loading, and CursorLoader for asynchronous loading from local database Cursors.

We saw that Loaders can free us from some of the constraints imposed by the Activity lifecycle, and took advantage of that to continue to work in the background even across Activity restarts.

In the next chapter we'll free ourselves completely from the constraints of the Activity

Get Asynchronous Android 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.