Android Application Development (AND-401) — Question 95
Which of the following is NOT true about class AsyncTask?
Answer options
- A. It must be used by sub-classing it.
- B. It must be created on the UI thread.
- C. Its sub-class override at least two methods: doInBackground, onPostExecute.
- D. It uses three generic types.
Correct answer: C
Explanation
The correct answer is C because while subclasses of AsyncTask do need to override the doInBackground and onPostExecute methods, they are also required to override onPreExecute. Options A and B are true, as AsyncTask must be subclassed and created on the UI thread, while option D correctly states that it uses three generic types.