(Android review) Task Stack and Startup Mode
This knowledge point is mainly understood as follows:
I. task stack)
1. function: it is used to manage the activity entry and exit. Records user behaviors.
2. Example:
Perform the following operations:
At this time, the activity in the task stack is as follows:
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD48cD62/qGixvS2r8Sjyr08L3A + PHA + Environment + PHA + PGFjdGl2aXR5PGJyIC8 + Environment = "orientation | keyboardHidden">
2. Category:
Standard: Click an activity to create an activity.
SingleTop: if the activity to be started is already on the top of the stack, no new activity will be created.
SingleTask: if the activity to be started is already in the task stack, it will find the activity and
All the above activities are cleared and then reused.
SingleInstance: This activity occupies a separate job stack. When you start such an activity
The reference of this activity will cut off the previous reference
3. Example:
Note: Use A to represent MainActivity, and use B to represent Main2Activity.
1) if you perform operations A ----> B --->,
In this case, the result in the job stack corresponding to standard and singleTop is:
2) if A ------> B --------> A ------> B,
The job stacks corresponding to singleTask and singleInstance are as follows: