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.