Вопрос

How to, when the application first started, lock on my application avoiding the event of any use of 'back' and 'home' button.
Only the application should have the ability to release the access to the device, the user is blocked to use his home or back button.

Is there any way, even if some hack is needed.

Sorry about breaking the freedom of Android, but it's a client specific need. He doesn't want his waiters kidding around with some Android's game.

Thank you.

Это было полезно?

Решение

For Back: override onBackPressed in your activity so that it doesn't call super.onBackPressed()

For the home button, check out this stack overflow thread.

Другие советы

Fortunately, there isn't a reliable way to do this. On any given Android device, the user can simply reboot in safe mode (hold down the Home key during boot) to disable all 3rd party apps (which means your apps) and run the standard apps/uninstall 3rd party apps. Android was designed to ensure that the user remains in control of his device.

Maybe it will work for whatever your client requires, but just know that it can be easily bypassed if the user knows how. :)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top