On Sun, Aug 15, 2010 at 5:37 PM, Filip Havlicek
<[email protected]> wrote:
> I'm just wondering what happens to running AsyncTask when the back button is
> pressed.

Nothing happens to your AsyncTask when the BACK button is pressed.

> Doesn't seem to invoke onCancelled or onPostExecute in my
> AsyncTask.

Correct. Bear in mind that AsyncTask does not have to be used by an
Activity. It could be used by a Service, for example.

> When I call cancel(false), onCancelled method is called, but doInBackground
> continues in execution

Correct. Passing false means you do not want to stop the task if it is
already started, versus just pending in the work queue.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to