How to handle an AsyncTask during Screen Rotation?

Posted by Janusz on Stack Overflow See other posts from Stack Overflow or by Janusz
Published on 2010-04-12T09:17:47Z Indexed on 2010/04/12 9:23 UTC
Read the original article Hit count: 585

I read a lot on how to save my instance state or how to deal with my activity getting destroyed during screen rotation.

There seem to be a lot of possibilities but I haven't figured out which one works best for retrieving results of an AsyncTask.

I have some AsyncTasks that are simply started again and call the isFinishing() method of the activity and if the activity is finishing they wont update anything.

The problem is that I have one Task that does a request to a web service that can fail or succeed and restarting the task would result in a financial loss for the user.

How would you solve this? What are the advantages or disadvantages of the possible solutions?

© Stack Overflow or respective owner

Related posts about android

Related posts about asynctask