Thanks, Mark.

Hmm, pressing the Back key so easily kills the activity. Is there a
way to trap Back key within an application and prevent/control this
behavior?

For sub-activity screens, does the Back key have the same behavior
(killing the app/activity) or does it go back to the parent activity
in the stack?


On Sep 11, 4:58 pm, Mark Murphy <[email protected]> wrote:
> Mark Murphy wrote:
> > If you wish to save something when the activity is being destroyed,
> > implement onDestroy() and save it. Where you save it (flat file,
> > SharedPreferences, database, the Internet) is up to you.
>
> > Bear in mind that onDestroy() may also be called in the case of a screen
> > rotation or other configuration change, since, by default, the current
> > activity is destroyed and started in that case.
>
> Actually, I should point out that more common places to save this sort
> of stuff are onPause() and onStop(), since your process may be
> terminated by Android to rapidly free memory without onDestroy() being
> called.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Training in Germany, 18-22 January 2010:http://bignerdranch.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to