Answers for "how to execute asynctask"

2

asynctask call other asynctask

Is it acceptable to create another asynctask & execute it from the first one?

Yes, but only inside onProgressUpdate() or onPostExecute() 
since these methods runs on the UI thread. 
Therefore, start the second AsyncTask on the UI thread by choosing 
one of the two methods listed above.

I'm wondering what publishProgress() from the second task would even do... 
since it was not started from an Activity?

It does exactly the same thing, since you are starting it from the UI thread.
Posted by: Guest on May-17-2020

Code answers related to "how to execute asynctask"

Browse Popular Code Answers by Language