Task: Similar to a stack, each time the interface is opened, a task is created and then the Open interface is placed into the task.
(1) Standard: default mode
Each time a new interface is created to add the interface to the task
(2) Singletop: Stack Top Single instance mode
A. If the target activity does not exist, create a new activity and deposit into the task
B. If the target activity already exists and is at the top of the stack, no new activity will be created
C. If the target activity already exists, but not at the top of the stack, create a new activity to store in the task
(3) Singletask: Single Instance in stack
A. If the target activity does not exist, create a new activity and deposit into the task
B. If the target activity already exists and is at the top of the stack, no new activity will be created
C. If the target activity already exists but is in the stack, all activity above the target activity will be destroyed
(4) SingleInstance: Global Single Instance
A. If the target activity does not exist, create a new task and a new activity to deposit the activity into the task
B. If the target activity already exists, move the activity's task to the foreground to show
Single-instance (singleton, single-state) SingleTon
(1) Declaring a class, privatizing its construction method
Private SingleTon () {}
(2) Create an object of this class type
private static SingleTon SingleTon = new SingleTon ();
(3) public static SingleTon getinstance () {
return singleTon;
}
(4) test
Intent flag bit
Set the intent flag bit
Intent.setflags (INTENT.FLAG_ACTIVITY_XXX);
A. Intent.flag_activity_single_top:
Similar to Singletop (stack top single instance) in Load mode
B. Intent.flag_activity_clear_top:
The effect is similar to Singletask in load mode, destroying all activity on the target activity (including itself) and then creating a new activity
C. Intent.flag_activity_new_task:
Note: If the startactivity jump interface is in service, the intent flag bit must be set.