Reputation: 5673
Suppose There are some activity.
I want to start another activity from the main activity. and another from that activity. and another from the next one.
This is how it is -
Main Activity -> Activity 1 -> Activity 2 -> Activity 3
Now I want to switch to Main Activity from Activity 3 without destroying Activity 3 or recreating a new instance of Main Activity.
I don't know is there any way to get it done.
If someone know about this. Let me know.
Upvotes: 2
Views: 470
Reputation: 10479
Take a look at the Process documentation
If a Activity has been started and you invoke it with an Intent for which you've set the FLAG_ACTIVITY_CLEAR_TOP, the other activities on the stack will be moved out of the way to make that one on top. To do this your Activities launchMode woul need to be set to singleTop, singleTask or singleInstance.
Upvotes: 3