I have setup the home button as enabled getSupportActionBar().setHomeButtonEnabled(true);
everything is fine I just want to disable the stacking of the activities, so that when I press the back button while I'm on my MainActivity the app will exit instead of going back to the previous activity.
This is happening because I'm navigating through the home button.
I tried adding i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
but it's the same result.
Any suggestions on how to disable the stacking?
You can set this in your `manifest
android:noHistory="true"
so that the Activities
aren't kept on the stack. You can do this for certain Activities
if you want. Alternatively, you can use the Intent Flag
Intent.FLAG_ACTIVITY_NO_HISTORY