AsyncTask and onDestroy...

Posted by stormin986 on Stack Overflow See other posts from Stack Overflow or by stormin986
Published on 2010-05-08T07:25:44Z Indexed on 2010/05/08 7:28 UTC
Read the original article Hit count: 285

Filed under:
|
|

I have an activity initiate a few AsyncTask downloads. After two of the three finish, it issues an Intent to load the next activity while still finishing up the last download.

Obviously in onDestroy() i will call cancel() on all AsyncTask objects.

If the OS tries to destroy my activity after the next activity starts, it will call and begin executing onDestroy in the apps UI thread, right? It won't wait for that AsyncTask to complete, correct? In all cases it will ultimately call onDestroy(), in turn canceling all AsyncTasks?

© Stack Overflow or respective owner

Related posts about asynctask

Related posts about activity