Start Android Activity with Clear Stack

By | June 6, 2014

This is a working solution how to start an Android Activity as the only one in the Back stack.


Intent intent = new Intent(currentActivity, MyActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
currentActivity.startActivity(intent);
currentActivity.finish();

Leave a Reply

Your email address will not be published.