Corresponding Joshui Teacher Video Tutorial 8th lesson
Be sure to watch this video
Each activity has its life cycle, turns it on, closes it, jumps to other activity, and so on, and automatically calls one of the following methods. After these methods are covered, observe the study.
protected void OnCreate (Bundle savedinstancestate);
protected void OnStart ();
protected void Onrestart ();
protected void Onresume ();
protected void OnPause ();
protected void onStop ();
protected void ondestory ();
Overwrite method: (extrapolate)
protected void OnStart ()
{
Super.onpause ();
LOG.I ("Mainactivity", "Mainactivity-->onstart");//Only add this sentence in the original method to output the log for viewing debugging.
}
Report:
When registering activity in the manifest, add
Android:theme= "@android: Style/theme.dialog" >
will make the activity into a dialog box form.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Learning Notes (5) Activity life cycle Learning