tags:

views:

67

answers:

2

In our app, we have Activities A,B,C,D, and E. The user usually goes from A to E.

In Activity E we want to go back to A, and get ride of B,C,D from the stack. We don't want to recreate A from E.

How do I 'pop off' B,C,D from the stack and then return to A ?

+1  A: 

If A is already running, you can use the FLAG_ACTIVITY_CLEAR_TOP flag when starting an intent to go back to A.

See also, similar questions:

http://stackoverflow.com/questions/3338841/how-to-clear-current-activities-in-the-stack

http://stackoverflow.com/questions/3408388/how-to-kill-sub-activities-and-bring-activity-to-top-of-stack

Mayra
A: 

Use the android:noHistory property in the manifest:

http://developer.android.com/guide/topics/manifest/activity-element.html

fredley