What can I do in 1.BaseActivity?
Define a context
Define a tag
Records the current Activity name GetClass (). Getsimplename ();
several overloaded methods in 2.Activity
Full life cycle
OnCreate () When the activity was first created
OnDestroy () before activity is destroyed
Visible life cycle
OnStart () When activity becomes visible from invisible
OnStop () when Activiy becomes completely invisible from visible (such as being completely overwritten by a new activity)
Foreground life cycle
Onresume () in activity from the top of the stack && still visible = = "Into the top of the stack, visible time
OnPause () When activity leaves the top of the stack but remains visible (such as being obscured by a dialog part)
Onrestart () changed from stop state to run state3.Activity Start-up modeThere are 4 startup modes, Normal, Singletop, Singletask, and SingleInstance, and the default is normal. How to modify: Add after Androidmanifest.xml's <activity tagandroid:launchmode= "Singletop"Normal mode: Equivalent to a normal javabean, can be repeatedly created Singletop mode: When the activity is started, if the top of the stack is found to be the activity, then no new instance is created Singletask mode: equivalent to Singleton, No matter if it is on top of the stack, there is only one instance of SingleInstance mode: It is also a singleton, but stored in a separate stack for two apps to share activity and jump4. Manage activity manuallyEstablish a class to store and manage activity and provide methods such as Addactivity, Removeactivity, Finishall () to invoke OnCreate () in Baseactivity's Addactivity () method , call the Removeactivity () method in OnDestroy to destroy all activity and kill process, then complete the app exit5. Activate the activity parametersIn order to make it clear that the parameters passed between the activity, it can be in the activated activity (e.g.secondactivity) Set a separate method, such as Start (), and give the required parameters. Call time, in such a wayPublic void OnClick (View v) {Secondactivity.actionstart (firstactivity.this, "data1", "data2");}
"First line code--android" read the activity of notes