On Sat, Dec 22, 2012 at 1:59 PM, Jonathan S <[email protected]> wrote: > onDestroy - The final call you receive before your activity is destroyed. > This can happen either because the activity is finishing (someone called > finish() on it, or because the system is temporarily destroying this > instance of the activity to save space. You can distinguish between these > two scenarios with the isFinishing() method.
That is a documentation flaw. Android does not "destroy this instance of the activity to save space", except by terminating the entire process. isFinishing() will distinguish multiple reasons for onPause() and onStop() being called (e.g., BACK will cause isFinishing() to return true, HOME will cause isFinishing() to return false). > finish() will call onDestroy() but not onStop() False. What lifecycle methods will be called on an activity when finish() is called depends on the state of the activity at that time. If the activity has not yet been paused, onPause() will be called. If the activity has not yet been stopped, onStop() will be called. Then, onDestroy() will be called. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.4 Available! -- 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

