1. What activity
is an interactive interface that fills the window or hovers over other windows, and an application consists of multiple activity, which specifies a master activity in the Mainifest.xml.
When the program runs for the first time, it sees the main activity, which is related to the activity by initiating other activity.
When other activity is started, the current activity will stop, new activity is pressed into the stack, colleagues get the user focus
Because the stack is advanced after the user back, the current page is destroyed, before the page is displayed
2. Life cycle of activity
7 Methods 3 stages:
void OnCreate (Bundle savedinstancestate)
void OnStart ()
void Onrestart ()
void Onresume ()
void OnPause ()
void OnStop ()
void OnDestroy ()
Start Activity:oncreate, OnStart, Onresume
Activity regain focus: Onrestart, OnStart, Onresume
Close Activity:onpause, OnStop, ondestory
The specific life cycle of the activity is as follows:
Overall life cycle: Oncreate->...->ondestory
Visual life cycle: Onstart->...->onstop
Focus Life cycle: Onresume->...->onpause
4. Introduction to Android Life cycle