How to Clear or Kill Stack of Activity – Android

Posted on .

When we use to navigate from one Activity to another than the previous values resides in our device stack so Here is  some Tips to clear  or kill it ..

METHOD 1 –

For API level 11 or greater, use FLAG_ACTIVITY_CLEAR_TASK and FLAG_ACTIVITY_NEW_TASK flag on Intent to clear or kill all the activity stack.

 

METHOD 2 –

Simply use  android:noHistory=”true” in AndroidManifest.xml file .

 

 

  • Rohit Kashiwal

    Java part working perfectly but XML is not y ?

    • Sorry but Code is correct , Try and clean with your project.