-1

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

AADProgramming
  • 6,077
  • 11
  • 38
  • 58
Yash Khan
  • 57
  • 5

1 Answers1

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