Android Startup Mode and androidlaunchmode
In Android, there are four Activity startup modes, which are described as follows:
Configure android: launchMode attributes in AndroidManifest. xml
1. standard:
Default start mode.
An instance is created each time, and can be used in each task stack.
2. singleTop:
The system will process the jump behavior in singleTop startup mode. When the jump is made, the system will first look for the stack structure to see if there is an Activity instance located at the top of the stack. If there is one, it will not generate a new one, but it will be used directly. If the system finds that there is an Activity instance, but it is not located at the top of the stack, regenerate an instance.
The singleTop startup mode is like this. If the corresponding Activity instance is found to be at the top of the stack, you can create only one instance after creation ). otherwise, a new instance is created without being at the top of the stack.
3. singleTask:
If a corresponding Acitivty instance is foundAboveAll Activity instances exit the stack, so that the acitiworkflow Instance becomes the top object of the stack and is displayed on the screen.
4. singleInstance:
The startup mode is special this time, because it will enable a new stack structure, place the Activity in the new stack structure, and ensure that no other Activity instances will enter.
Only one independent task stack exists, and only one task stack is included.
1. Is the text expression abstract?
SingleTop
SingleTask
SingleInstance
2. Where can these startup modes be used?
3. What is the secret behind the startup mode?