The activity life cycle graph extracted from the Android API documentation is as follows:
There are four states of activity
A, active activity in the screen foreground, get the focus can interact with the user, only one activity is active at the same time
B, suspend state activity visible but loses focus (obscured by other activity or under transparent Activiy)
C, stop state activity is completely obscured by another activity, but retains user state information D, inactive activity has not been started or has been manually terminated or is being reclaimed by the system due to insufficient memory
Important methods in the activity life cycle
A, OnCreate loading layout files, binding various types of monitoring events
B, OnStart interface visible but failed to get focus, cannot interact with user
C, Onrestart when the activity executes the OnStop method, then the boot time will be called
D, Onresume interface visible and can get the focus, can interact with the user
E, OnPause interface loses focus, but visual
F, onstop when activity is not visible at all
G, OnDestroy manual call to finish or low memory system recovery
For example, the activity of each method switch, a new a,b,c three activity, where B is set to transparent
A, start the main page a,oncreate (a)-OnStart (a)-Onresume (a)
B. Open transparent B,onpause (A)-oncreate (b)-OnStart (b)-Onresume (b)
C, click the Back button to return to the page A,onpause (b)-Onresume (A)-OnStop (b)-OnDestroy (b)
D. Open Full Screen page c,onpause (a)-onCreate (c)-OnStart (c)-Onresume (c)-OnStop (a)
E, click the Back button again, OnPause (c)-Onrestart (a)-OnStart (a)-Onresume (a)-onStop (c)-OnDestroy (c)
F, then click Back OnPause (a)-onStop (a)-OnDestroy (a)
Android Activity life Cycle