in the write Baidu push when the binding will jump to the home page, if not set in manifest lanchmode=singletask, will keep jumping.
1, standard starting modeThis method is also the default for the system. The simple point is that when we use the StartActivity () method, the system startsa new instance of activity, regardless of whether it was previously started or not. If you want to know the details of this post can be viewed http://marshal.easymorse.com/archives/2950, I am not carefully explained here. Map Description:
2, singletop start modeIf you understand the standard starting mode, I will say the difference, we will understand. If we're going to call theactivity at the top of the task stack, instead of creating a new instance in standard mode, the system calls the Onnewintent () method to boot the intent to the top of the stack. If the callingactivity is not on top of task stack, the system is called in the same manner as the standard mode. As an example:
Now the task stack element is a-b-c-d (d at the top of the stack), this time to send a start intent D, if D is "standard", then a new instance of D is generated, the stack becomes a-b-c-d-d.
If D is singletop, a new instance of D will not be produced, and the stack state is still a-b-c-d
If at this time to B hair intent, whether B launchmode is "standard" or "singletop", will generate a new instance of B, the stack status becomes A-b-c-d-b.
Note: The user cannot use the Back button to return to the previous activity while an activity is handling a new intent. It is not possible until the new intent arrives in the Onnewintent () method.
3, Singletask start mode
If there is already another task and contains an activity instance, call the instance of that task directly. (there is only one task in it) instead of creating a new instance. Important: If you start a singletask activity and the activity is in the background task, then the entire background task will be transferred to the foreground. The following picture is a good illustration of this problem.
Someone asked what would happen if I called activity X in the diagram? The system will destroy activity y first and then put activity x in the foreground.
4, singleinstance start mode
SingleInstance creates a new task, and only one instance of it is in the task. (Only one task will have it, and it is only in that task). "SingleInstance" is the only activity on its stack, which is reused every time.
Summarize:
Standard is new each time, each task can have, and each task can have multiple instances (each task can have, and can have more than one)
Singletop If the current instance is at the top of the stack, the instance is not created and its onnewintent is called. If not at the top of the stack, create a new instance (each task can have and can have multiple, reusable at the top of the stack)
Singletask creates a new task, and if there is already another task and contains the instance, call the instance of that task directly. (Only one task will be available)
SingleInstance creates a new task, and only one instance of it is in the task. (Only one task will have it, and it is only in that task)
The intent flag can override the activity's startup mode:
Flag_activity_new_task similar to Singletask
Flag_activity_single_top similar to Singletop
Flag_activity_clear_top No correspondence
add something missing from the description .
The user must be able to leave a task, and then return to this task. Therefore, "Singletask" and "singleinstance" can only be used as properties to initiate activity. If this is not the case, after we start a singletask activity, using the home key to the main interface, we will not be back, because it does not represent the launch of an application.
Android's Android:launchmode