Async Task Flashcards
1
Q
Explain the role of the UI thread…
A
The UI thread is the equivalent to the main thread in a Java program. It deals with all user interactions.
2
Q
When the UI thread wants to hand-off to another thread, what does it do?
A
Sends a hand off request to AsyncTask.
3
Q
Where is the created AsyncTask class located? What class does it extend?
A
AsyncTask is defined as an inner class.
It extends AsyncTask.
4
Q
What generics are included when extending AsyncTask?
A
Params
Progress
Result
5
Q
What are the 4 methods in AsyncTask?
A
onPreExecute( ) -> Configure pre-requisites in the UI thread.
doInBackground( Params ) -> Define the execution of the AsyncThread.
onProgressUpdate( Progress )
onPostExecute( Result )