Answer the question
In order to leave comments, you need to log in
How to intercept pressing the hardware Home button?
There are two activities in the application - the main one with the menu and the one called from the menu. It is required in the second activity to intercept and prohibit pressing the hardware Home button, but in the first one (appearing at startup) there should be such an opportunity.
Rewriting the onKeyDown() method only intercepts the hardware Back button, but the other two work independently and simply don't come to this method.
PS: for a better understanding of what you want to get: there is a test in the second activity. Users should be prevented from bypassing this test.
Answer the question
In order to leave comments, you need to log in
No, Android doesn't have an API for that. And for what there was such task, tell, please. Maybe there are other options.
google kiosk mode android
, you can make the application a launcher, or check that the application is running, if not, launch ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question