2

I want to clear Activity stack at runtime based on some conditions such that

.if(int a=int b) { // clear activity stack }

Please help

Shantanu Jha
  • 145
  • 1
  • 4
  • 10
  • What do you mean by "clear activity stack" ? activity is a class - it doesn't have a "stack". Further, your code won't compile. try to explain what you want to achieve not how you're trying (or believe you should try) to achieve it. – Nir Alfasi Aug 27 '15 at 06:12
  • I just want that when user presses back button ...then based on some condition it should clear all the activity history in the stack. – Shantanu Jha Aug 27 '15 at 06:15
  • possible duplicate of [Android: Remove all the previous activities from the back stack](http://stackoverflow.com/questions/12947916/android-remove-all-the-previous-activities-from-the-back-stack) – Nir Alfasi Aug 27 '15 at 06:17
  • like what we do by this code intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); – Shantanu Jha Aug 27 '15 at 06:17

0 Answers0