Chapter 2. Staying Responsive with AsyncTask
The first Android-specific concurrency construct we'll look at is android.os.AsyncTask
, a neat construct that encapsulates the messy business of managing threads, performing background work, and publishing progress and results back to the main thread to update the user interface.
In this chapter we will cover the following topics:
Introducing
AsyncTask
Declaring
AsyncTask
typesExecuting AsyncTasks
Providing feedback to the user
Providing progress updates
Canceling AsyncTasks
Handling exceptions
Controlling the level of concurrency
Common
AsyncTask
issuesApplications of
AsyncTask