Activity launchMode
suggest changeLaunch mode defines how a new or existing activity is placed in a task. The possible launch modes are:
- standard
- singleTop
- singleTask
- singleInstance
Set it in the manifest on the <activity> element with the android:launchMode attribute. The value is one of standard, singleTop, singleTask, or singleInstance.
<activity
android:launchMode="standard" />
Standard:
This is the default. A new activity is created for each new intent, so many activities of the same type can exist. The new activity is placed on top of the task. There is a version difference when the activity is started from another application: on Android 4.4 and earlier it is placed in the same task as the caller, but on Android 5.0 and later a new task is created.
SingleTop:
This mode is almost the same as standard. Many instances of a singleTop activity can be created. The difference is that if an instance of the activity is already at the top of the current task, onNewIntent() is called instead of creating a new instance.
SingleTask:
An activity with this launch mode can have only one instance in the system. A new task is created for the activity if one does not already exist. Otherwise the existing task is brought to the front, activities above this one are finished, and onNewIntent() is called.
SingleInstance:
This mode is similar to singleTask. The difference is that the task holding a singleInstance activity can contain only that activity. When a singleInstance activity starts another activity, a new task is created for it.