0

I had an app that i want it exit a specific activity for example: A -> B -> C but everytime i press the back button from activity C it always bring me back to B and from B to A before exiting. Is there anyway that I can exit directly from C no need to go through B and A again?

chenhou90
  • 23
  • 7
  • This may be of interest: http://stackoverflow.com/questions/2033914/quitting-an-application-is-that-frowned-upon – ernazm Sep 19 '11 at 15:12

2 Answers2

1

If you know A and B are complete, call finish() within each of them after they've started the next activity.

mah
  • 39,056
  • 9
  • 76
  • 93
0

If you don't want an Activity to show up in the history, you can define it in the manifest file with the noHistory attribute. I've done this for a few of my activities.

<activity android:name="com.sample.activity.MyActivity" android:noHistory="true" />
brianestey
  • 8,202
  • 5
  • 33
  • 48