Hi My service displays a system alert window which displays on top of all other activities similar to how facebook displays chatheads on top of other activities. This is done using WindowManager. My problem is that I need to remove it when user presses the home button and so far I am struggling to find a way to detect home button that would work on Android Lollipop. Any pointers would be appreciated. Thanks
Asked
Active
Viewed 496 times
-1
-
Maybe the person down voting the question also comment why it is a bad question. – Yash Khan Mar 22 '15 at 12:35
-
You may also want to check this Link: http://stackoverflow.com/questions/18103091/detect-home-button-pressed-event-in-android-service-displaying-a-ui-similar-t – AADProgramming Mar 22 '15 at 12:41
-
Thanks AADTechnical. – Yash Khan Mar 22 '15 at 13:15
1 Answers
1
It is impossible to detect and/or intercept the HOME button from within an Android app. This is built into the system to prevent malicious apps that cannot be exited.
It's a bad idea to change the behavior of the home key. This is why Google doesn't allow you to override the home key.
You may refer this LINK for more info/discussion.

Community
- 1
- 1

AADProgramming
- 6,077
- 11
- 38
- 58