Issue
in my application, when I start a specific activity I want all the activities in the same package to be cleared from the stack underneath. Could someone help me on how to do this?
Also I do not want to use android:noHistory="true"
in the manifest because I only want the stack history to be cleared on starting this specific activity.
EDIT:
To make my point more clear, suppose I have activity a. From a I start activity b. From b I start c. But when I start c I want to clear b and a.
Solution
Oh guys, I figured out that you just have to put the following code with the Intent which starts the stack clearing activity:
Intent i = new Intent(this,MyActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
Thanks for your help though.
Answered By - Tanuj Nayak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.