On Fri, Sep 10, 2010 at 9:53 AM, Maps.Huge.Info (Maps API Guru) <
cor...@gmail.com> wrote:

> What if that AsyncTask is downloading a file? Interrupting it,
> regardless of how nicely done, would be a bad thing wouldn't it?
>

You don't need to interrupt it.  See Mark's option 2.  Just don't have it
tied to a specific activity instance.

If you want to have it associated logically with the activity, you can use
onRetainNonInstanceState() to transfer it between instances.  (Though this
is intended as an optimization, and if you rely on this then you likely
won't get the proper semantics in other cases -- for example if the user
leaves your app and returns to it later it could easily get killed while in
the background and thus lose the active download.  In fact you would also
have this same problem if you use android:configChanges for many of the same
reasons.)

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to