0

I need something to block "Recent apps" and "Home" buttons, but I don't need to block them completely, only to prevent an accidental exit from the application. Most often you could see a toast with a message "Click again to exit the app" in this case, so I want something similar. So for "Back" button it will be really easy to do, but for others it's not.

I found this link. But my phone creates strange bottom chooser dialog, when I click "Home" button, and I am not sure, that I can undo this actions.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
ks north
  • 13
  • 5
  • Does this answer your question? [how to disable home button in android?](https://stackoverflow.com/questions/17183905/how-to-disable-home-button-in-android) – M. Prokhorov Jan 31 '20 at 16:17
  • @M. Prokhorov no. I tried everything that suggested there, but making my activity HOME, creates strange dialog, and the answer that it is not possible isn't quite right. Because you can see the toast that I mention in my question inside fullscreen games for example. – ks north Jan 31 '20 at 16:35
  • Yes, it is supposed to "create strange dialog". Android doesn't allow complete override of the home button, user will still have a deal of control, i.e. which of the installed apps that provide a "home" screen he wants to go to when the button is pressed. – M. Prokhorov Jan 31 '20 at 16:36
  • @M. Prokhorov yes, but somehow apps control this buttons without any system dialogs. – ks north Jan 31 '20 at 16:47
  • Which apps? I haven't seen this anywhere. – M. Prokhorov Jan 31 '20 at 17:28
  • M. Prokhorov for example https://play.google.com/store/apps/details?id=com.king.candycrushsaga – ks north Feb 03 '20 at 08:27
  • It doesn't intercept home button from what I can tell - only the "back". – M. Prokhorov Feb 03 '20 at 12:08
  • @ M. Prokhorov maybe it has different behavior on different phones, in my case it intercept all buttons that can close the app – ks north Feb 03 '20 at 12:42

0 Answers0