Novice Android Developers may often ignore this important setting.
The activity has the following four kinds of Launchmode:
1.standard
2.singleTop
3.singleTask
4.singleInstance
We can configure <activity> the Android:launchmode attribute in Androidmanifest.xml for one of the above four kinds.
Summary description:
0 standard----standards, each time you open the same activtiy page will be a new instance of the stack innovation, the default is this
1 Singletop----If the instance object already exists in the stack, it will not be created again, just open the same activity for the current event
If another page opens, the activity will still create the object on the stack (whether it is on top of the stack)
2 Singletast---The entire application creates only one instance, if it is already in the stack, it will be closed first, always at the top of the stack.
3 SingleInstance---The entire application creates only one instance, except that the activity opened above it is placed in a new task alone
That cannot be shared with his own task
This mode is typically used to load slower, less expensive activity that does not need to be recreated every time.
Activity start mode differences and optimizations