0

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?

Bri6ko
  • 1,858
  • 1
  • 18
  • 29
  • Did your read this ? http://stackoverflow.com/questions/1898886/removing-an-activity-from-the-history-stack – Alexis C. May 22 '13 at 18:02
  • No, :/ I guess I was using the wrong keywords for the search criteria, I focused more on the fact that I'm using Sherlock, thought that was the problem. Thanks – Bri6ko May 22 '13 at 18:15

1 Answers1

0

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
codeMagic
  • 44,549
  • 13
  • 77
  • 93