I noticed that the Android Developers Activity section has been updated since I started my app, but I am still unclear what the simplest Activity Lifecycle is.
As fa
Are you looking for this?
To further answer your question, yes, as you can plainly see from the above diagram the "simplest" (i.e. smallest number of method calls) lifecycle is indeed onCreate(); onStart(); onResume(); onPause();.
You should also know about onSaveInstanceState() and onRetainNonConfigurationInstance(). These are NOT lifecycle methods.
All these methods are very well documented. Please read this documentation thoroughly.
To clarify things further, here are a couple of real-life scenarios:
onPause is called. System runs out of memory, calls onSaveInstanceState, kills activity. User pressed back a few times, activity has to be re-instantiated (preferably using the data saved in onSaveInstanceState).onPause->onDestroy are called, without calling onSaveInstanceState.You should understand the essential difference between onPause and onSaveInstanceState. The former is always called, while the latter is only called when the activity instance might be re-instantiated in the future. Following this train of thought, your users will expect two things:
onSaveInstanceState). They don't expect that if they exit your activity. However:onPause). For example, if they started composing a message, they'll expect to see it as a draft the next time they come back, even if they exited the activity.You should understand how these methods are supposed to be used in order to get what your users expect. How you actually use them is up to you, your needs, and your app's nature.