androidandroid-activityback-buttonandroid-homebutton

How to kill all my application's activities?


How can I kill all the Activities of my application?

I tried using this.finish() but it just kills one Activity.

In fact, I would like when the user touches the back button (in only one of the activities), the application to do the same as if he pressed the Home button.


Solution

  • You can set android:noHistory="true" for all your activities at AndroidManifest.xml. Hence they will not place themselves onto history stack and back button will bring you to the home screen.