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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What generics are included when extending AsyncTask?

A

Params
Progress
Result

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly