You can use Activity.isFinishing(). On Wed, Oct 14, 2009 at 1:49 PM, Mark Wyszomierski <[email protected]> wrote:
> > Hi, > > Is there a reliable way to tell if an Activity is being destroyed due > to rotation, or if it's really being removed from display? > > My activity has to do some lengthy background process. If the user is > simply rotating the phone, I don't want to cancel the bg process. If > the user is going to a new activity, or hitting the back button, then > I'd really like to terminate the bg process. > > I'm not sure how to discern between these two situations other than > listening for the back key being pressed, but I'm not sure if this is > reliable at all. Is this the only way a user can terminate the current > Activity? > > Thanks > > > -- Dianne Hackborn Android framework engineer [email protected] 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 [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 -~----------~----~----~----~------~----~------~--~---

