0

When I pressed the home button, it will return to home, but the app is still running in the background.

How can I make my app completely shut down after pressing the home button?

Eason
  • 469
  • 4
  • 14

2 Answers2

1
android:clearTaskOnLaunch="true" 
            android:launchMode="singleTask"
            android:excludeFromRecents="true"

Add these lines inside the Aandroid Manifest in activity that you launches...

Khubab Hamza
  • 184
  • 12
1

Check out the solution of this question and override accordingly.

Can I override the 'Home' button in my application?

Community
  • 1
  • 1
Najeebullah Shah
  • 4,164
  • 4
  • 35
  • 49
  • @YichenWang the solution here might help you: http://stackoverflow.com/questions/2208912/how-can-i-detect-user-pressing-home-key-in-my-activity – Najeebullah Shah Apr 13 '15 at 08:04