The correct way to achieve this is to use the following:
Intent intent = new Intent(this,MyActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME); startActivity(intent); this.finish();
The code assumes that you are in action, otherwise, if you use fragments, use getActivity ()
Thus, the action starts, you correctly set your hierarchy for your return button, and also destroy the corresponding activity.
Jeremie Nov 09 '15 at 19:10 2015-11-09 19:10
source share