Implementing a simple AsyncTask
Let's get into the details now. We will show you the following through source code:
- How to extend
- How to pass constructor arguments
- What methods to override
- How to set up a progress dialog through the
- Where to do the actual work: the
- How to trigger progress callbacks
- How to override the progress method to report progress
- How to detect the end of work through the
We will start with how to extend
AsyncTask as it uses generics and is worth spending a few minutes on.
GettingPpast the Generics in AsyncTask
AsyncTask class employs generics to provide type safety to its methods.
AsyncTask (through generics) wants you to specify the following ...