Issue
Just 3 simple questions about AsyncTasks. If we declare this AsyncTask:
private class DownloadFilesTask extends AsyncTask<URL, Integer, Long>
1- What type of value is passed to doInBackground() method? Is it URL?
2- What type of value is passed to the callback that informs the task progress?
3- What type of value is passed to the callback that is executed when the task ends?
Thank you all. Rest of a good day
Solution
AsyncTask consists of Input Parameter Type, Progress Parameter Type, Result Type respectively. So in your case
DownloadFilesTask extends AsyncTask<URL, Integer, Long>
URL
is the Input Parameter Type
Integer
is the Progress Parameter Type
Long
is the Result Type
What type of value is passed to doInBackground() method? Is it URL?
Answer: Yes its the URL
What type of value is passed to the callback that informs the task progress?
Answer: its
Integer
What type of value is passed to the callback that is executed when the task ends?
Answer : Its
Long
value and it is the value that is expected to return fromdoInBackground
and passed as a callback to onPostExecute`.
Answered By - Faisal Naseer
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.