How do I clear the stack without starting another activity? I tried
testIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(testIntent):
But it requires me to start another activity. Is there any other way? Please help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have you seen this post: Removing an activity from the history stack
That may or may not be helpful.
You can add a
android:noHistory="true"to your<Activity />inAndroidManifext.xmlor you can use the FLAG_ACTIVITY_NO_HISTORY when calling your activity.Without knowing exactly why you need this functionality, I can’t offer any suggestions on how to implement. Maybe you can find a way to reorganize your app so that you can take advantage of this.