LoadContactTask Subclass of AsyncTask

Nested class LoadContactTask (Fig. 8.49) extends class AsyncTask and defines how to interact with the database to get one contact’s information for display. In this case the three generic type parameters are:

Long for the variable-length argument list passed to AsyncTask’s doInBackground method. This will contain the row ID needed to locate one contact.

Object for the variable-length argument list passed to AsyncTask’s onProgressUpdate method, which we don’t use in this example.

Cursor for the type of the task’s result, which is passed to the AsyncTask’s on-PostExecute method.

148      // performs database query outside GUI thread149      private class LoadContactTask ...

Get Android™ How to Program, Second Edition 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.