On Mon, Sep 20, 2010 at 9:48 PM, TreKing <[email protected]> wrote:

> Assuming you control all activities, you can start them all using
> startActivityForResult() then pass back an "exit" code of some sort, such
> that upon receiving this message, each activity knows it needs to finish()
> itself.
>

Another approach you can take is to use Intent.FLAG_ACTIVITY_CLEAR_TOP to
restart the top activity of your app, causing all between you and it to
finish, and that one can handle onNewIntent() with the intent you send it to
finish itself.  However...


> Note that this will only finish your activities, but AFAIK the process will
> remain at Android's discretion to be re-used later, if need be.
>

Yes, this has no impact on whether the process continues to run.

You don't want to stop the process from running.  All that would do is make
your app slower to start the next time the user returns to it.  (In fact
finishing the top activity also makes it slower, because otherwise when the
launch it again that activity can just be brought directly to the
foreground.)

-- 
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

Reply via email to