I think my ideas about activity life cycle and ligaments
a little confused, can you help me?
Suppose a user opens activity A on the main screen,
activity A βtriggersβ activity B , which fills the screen.
On this event, onSaveInstanceState() calls activity A , then onPause() and onStop() .
Since the system has too many applications running on the system,
andorid decides to kill activity hosting process A.
When the user proceeds to activity A , onCreate () is called as soon as possible, use the package (installed during the last call to onSaveInstaceStae ()) to restore the state. then onStart() , onRestoreInsanceState()
and onResume() ,
I'm right?
Then let's assume that the user presses the back key to exit activity A
onPause() , onStop() and onDestory() are called sequentially by activity A (the call to onDestroy() can be delayed, though) onSaveInsanceState() should not be called in this script.
When the user reopens activity A later, then the packet passed to onCreate () is null, right?
Now suppose the user rotates the screen onSaveInsanceState() , onPause() , onStop() , onDestroy() are then called onCreate() with the bundle set by the last call to onSaveInsanceState() ,
and then onStart () and onRestore (). I'm right?
I suppose that:
when the user creates activity, the packet passed to onCreate() is always zero, and onRestoreState() never called, but when the system creates it, for example, when it killed activity due to low memory or due to the rotation event passed the bundle is the one that was set by the last call to onSaveInstanceState ().
Did I understand correctly?
thanks and sorry for my bad english.
PS: I think that onRestoreInstanceState() is passed, the same package is passed onCreate() , but usually the state is restored using onCreate() .