Skip to content

Instantly share code, notes, and snippets.

@mstoic
Last active September 10, 2018 07:28
Show Gist options
  • Save mstoic/f024ad58082844b28f1f7ef7b9c3a34f to your computer and use it in GitHub Desktop.
Save mstoic/f024ad58082844b28f1f7ef7b9c3a34f to your computer and use it in GitHub Desktop.
A flag to close all previous activities of your app
// Close all previous activities
// https://stackoverflow.com/questions/6330260/finish-all-previous-activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
// 10-09-18 - Not working in App Lock.
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment