Activity startup mode setting: <activity Android: Name =". Mainactivity"Android: launchmode ="Standard"/>Four startup modes of activity:1.In standard mode, an activity is created every time an activity is activated and placed in the task stack.2.Singletop: if an instance of the activity exists at the top of the stack of the task, the instance will be reused, otherwise, a new instance will be created and placed on the top of the stack (even if the activity instance already exists in the stack, the instance will be created as long as it is not on the top of the stack ).3.If a singletask has an instance of the activity in the stack, it will reuse the instance (onnewintent () of the instance will be called ()). When it is reused, the instance will be sent back to the top of the stack, so the instance on it will be removed from the stack. If this instance does not exist in the stack, a new instance is created and put into the stack.4.Singleinstance creates the activity instance in a new stack and allows multiple applications to share and modify the activity instance in the stack. Once an instance of a modified activity exists in a stack, any application that activates or changes the activity will reuse the instance in the stack. The effect is that multiple applications share one application, no matter who activates the activity, it will enter the same application.
The first entry is used by default:Standard
What are the startup modes of activity?