|Launch Mode with example|
Types of Launch Mode
Standard launch mode is the default launch mode for all activities defined in the android manifest file. In this mode each time we call the new activity through startActivity(intent) it will create a new instance of that activity within the current task. So multiple instances of same activity will be created within the current task
If activity instance already exists on top of the stack then no new instance will be created.New instance only will be created if activity A is called by activity B and no new instance of B is yet created in the task or present at any other position other than the top. Refer below image.
The system creates a new task and pushes the activity at the root of the task. If activity A instance exists in the task stack and if it's called by any other activity lets say D then no new instance of activity A will create rather activities above A will be cleared from task stack and activity A will now be at the top. Refer below image
It's same as singleTask only difference is no new activity will be pushed to the task holding singleInstance activity.