The startup mode is simply the Activity startup policy, the <Activity> tag's Android:launchmode property setting in Androidmanifest.xml;
The starting mode has 4 kinds, namely standard, Singletop, Singletask, singleinstance;
Activity startup mode settings:
<activity android:name= ". Mainactivity "android:launchmode=" standard "/>
Four startup modes of activity:
1. Standard
mode startup mode, activity is created each time the activity is activated and placed in the task stack.
2. Singletop
If there is an instance of the activity at the top of the task, reusing the instance will create a new instance and put it in the top of the stack (even if the activity instance already exists on the stack, as long as it is not on top of the stack, an instance will be created).
3. Singletask
If an instance of the activity is already in the stack, the instance is reused (Onnewintent () of the instance is invoked). When reused, the instance is returned to the top of the stack, so the instances above it will be removed from the stack. If the instance does not exist in the stack, a new instance is created to be put into the stack.
4. SingleInstance
Create the activity instance in a new stack and have multiple apps share the activity instance in the stack. Once an instance of the activity in the schema is present on a stack, any application that activates the activity will reuse the instance in that stack, with the effect of sharing an app with multiple applications, regardless of who activates the activity into the same application.
Android Boot mode