0
Hi androidians,

I have many modules in my application i can go from one module to other by some link. But before going to other modules i want to close all activities related with previous one you can say i have stack of activities for each module i want to clear it before starting with other modules stack.

**Example**
 Module1 contains Activity 1,2,3 Module 2 Contains Activity 4,5,6 

I travel from go 1->2->3(of module1) if i move from 3->4(of module2) i want to finish activity 1,2,3(of module1)

Swapnil Deshmukh
  • 665
  • 1
  • 6
  • 23
  • 1
    Have a look at my answer to this question: http://stackoverflow.com/questions/11430993/activities-stack-issue/11435380#11435380 – David Wasser Oct 12 '12 at 20:07

1 Answers1

2

you can use a flag to clear all other activities in the stack

or a flag to clear history, which should clear the activities in the history

this can be a flag in your intent, before you start the activity FLAG_ACTIVITY_CLEAR_TOP

http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_CLEAR_TOP

CQM
  • 42,592
  • 75
  • 224
  • 366