One, Android task stack
Overview: The task stack in Android is actually a collection of activity, in the Android to exit the program must be all the activity in the task stack to clear the stack, this time to safely complete exit program,
Task stack destruction is the most secure state of the data, if not deleted, it is necessary to reasonably save the task stack, so that the task stack will retain the status of each activity, will also save the activity information,
The task stack is not necessarily unique, and there is more than one task stack in an activity, and in some cases, the activity can also have a single task stack (singleinstance).
Second, activity startup mode
1.STANDRD (Standard boot mode): This mode will recreate an activity instance each time the activity is started, adding it to the task stack, and not considering whether the instance exists in a task.
This will take the corresponding life cycle method for each instance created.
2.SingleTop (stack top multiplexing mode): each time the activity is started to determine the existence of the top of the stack, at the top of the stack is reused, not the top of the stack will still be recreated.
3.SingleTask (in-stack multiplexing mode): each time the activity is activated, it detects the presence of the activity in the entire task stack, which is placed on top of the stack and destroyed from the task stack by all activity.
4.SingleInstance: activity initiated in this mode will have a single task stack, and only one instance of it, with a single task stack. (this mode is seldom used)
"Android-3" task stacks (tasks) in Android