I want to know if there are any consequences to starting an AsyncTask in another AsyncTask's doInBackground() method. I've read that it's not recommended, but I'm not seeing any consequences thus far.
I've started AsyncTask A like so:
asyncTaskA.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
then I initiate AsyncTask B from AsyncTask A's doInBackground() method like so:
protected Void doInBackground(Void...params){
asyncTaskB.execute();
}
Based on what I've seen so far, The onPostExecute() method of AsyncTask B still ends up in the main UI thread as expected. I also believe that even if AsyncTask A dies (the parent task) AsyncTask B will continue.
I've heard that executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR) enables parallel execution, but I'm not 100% sure what that means code wise. Does it specifically enable the functionality that I'm seeing? AKA, the ability to execute nested async tasks from the doInBackground() method of the task itself.
Thanks.