First, the activity has 4 kinds of starting mode
- Standard: For this mode of activity, the system does not care if it already exists in the return stack, and each start creates an instance of the activity
- Singletop: If you find that the stack top of the return stack is already the activity when you start the activity, you think you can use it directly and no new instances will be created
- Singletask: The system checks to see if an instance of the activity exists in the return stack before starting the activity, and if the discovery already exists, all the activities on top of that activity will be stacked
- SingleInstance: The activity in this mode enables a new return stack to manage this activity, regardless of which application accesses the activity, sharing a return stack, which solves the problem of shared activity instances
Second, how to specify a different startup mode for the activity?
In Androidmanifest.xml, the activity node of the event is specified, as follows
1 < activity 2 android:name = ". Activity " 3 Android:launchmode Span style= "color: #0000ff;" >= "Singletop" > 4 < intent-filter > 5 </ intent-filter > 6 </ activity >
Iii. questions left to themselves
What are the 4 different boot mode activities applied to each scenario?
"Android first line code" learn to record the starting mode of 006-4 kinds of activities