Created
November 8, 2016 06:55
-
-
Save umarpazir11/4b2df4426d253c0dee1f1fa1793e8297 to your computer and use it in GitHub Desktop.
Normally when we launch new activity, it’s previous activities will be kept in a queue like a stack of activities. So if you want to kill all the previous activities, just follow these methods.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Intent i = new Intent(OldActivity.this, NewActivity.class); | |
// set the new task and clear flags | |
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK) | |
startActivity(i); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment