In this chapter, we've taken a detailed look at AsyncTask
and how to use it to write responsive applications that perform operations without blocking the main thread.
We saw how to keep users informed of the progress, and even allow them to cancel operations early. We also learned how to deal with issues that can arise when the Activity lifecycle conspires against our background tasks.
Finally, we considered when to use AsyncTask
, and when it might not be appropriate.
In the next chapter we'll learn about Loader—a construct designed to streamline the asynchronous loading of data on the Android platform.