An AsyncTask
is basically executing what you want in the background as a separate thread from the UI. So when you quit the UI this doesn't necessarily mean that you've killed the AsyncTask. It will continue it's regular life cycle and end in onPostExecute
. If you want to kill the AsyncTask
too then you will have to call the cancel()
function for the AsyncTask
.
Know this though, you cannot actually kill an AsyncTask
this will be done by Android itself. So you will have to wait a while till the current task is killed (if you call cancel()
) for you to restart this particular AsyncTask
.
You should also read up on onCancelled()
methods. For more information checked out the documentation.
If I've made any mistakes, please correct me.