On Sat, Jan 15, 2011 at 12:35 PM, Kevin Duffey <andjar...@gmail.com> wrote:

> I thought you weren't really supposed to "quit" an app? I know the Android
> system will kill an app when necessary to reclaim resources. I have seen
> apps, including google maps that allow you to exit. In the case of google
> maps, if you're using the navigation, and don't exit, it keeps on talking
> and drains your battery pretty fast. I've learned from experience to exit
> that app! So I guess I can see a time when it should exit. But I thought by
> listening to the activity events of pause/resume, and so forth you can use
> those to exit the app gracefully?
>

In navigation, exit isn't exiting the app, it's exiting the active (very
power hungry) navigation mode of the app.


> For that matter, since games use threads, don't they have to stop the
> threads, save state, and such when a user presses home to exit out of it?
>

Yes they should.  Which is the same as if the user receives a phone call,
etc. When the user leaves your app for whatever reason, you should stop your
execution.  Of course this is fuzzy: if the user has explicitly asked you to
continue doing some work (playing music, navigating) then of course you will
do so (but this work is associated with a service, not an activity); and
some apps may continue doing some remaining work immediately after the user
leaves, such as finishing the retrieval of a web page in the browser.

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