Shaiful
Shaiful

Reputation: 5673

Android Problem : Switching Between Activity in Activity Stack

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

Answers (1)

Nick Campion
Nick Campion

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

Related Questions