I recently studied several startup modes of activity, which are summarized as follows:
The four startup modes are as follows:
"Standard" (default)
"Singletop"
"Singletask"
"Singleinstance"
Standard is created every time, and each task can have multiple instances (each task can have multiple instances)
If the current singletop instance is at the top of the stack, the onnewintent of the instance will not be created. Create an instance if it is not on the top of the stack(Each task can have multiple tasks that can be reused at the top of the stack)
Singletask creates a new task. If another task already exists and contains the instance, the instance of the task is called directly. (Only one task exists)
Singleinstance creates a new task and has only one unique instance in the task. (Only one task exists, and only one task exists)
Set Through intent
Flag_activity_new_task is similar to singletask.
Flag_activity_single_top is similar to singletop
Flag_activity_clear_top clear