S
S
svd712016-03-20 11:22:01
Android
svd71, 2016-03-20 11:22:01

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

3 answer(s)
D
Denis Zagaevsky, 2016-03-20
@zagayevskiy

No, Android doesn't have an API for that. And for what there was such task, tell, please. Maybe there are other options.

O
Oleg Gamega, 2016-03-20
@gadfi

google kiosk mode android
, you can make the application a launcher, or check that the application is running, if not, launch ...

B
belozerow, 2016-03-20
@belozerow

You can do this
stackoverflow.com/questions/17549478/how-to-disabl...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question