Reputation: 665
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)
Upvotes: 0
Views: 82
Reputation: 44230
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
Upvotes: 2