Android Question disable device button

SMOOTSARA

Active Member
Licensed User
Longtime User
Hello friends

May you guide me How to disable clicking the following buttons?
and
What code should be written to disable them?

Thank you
 

Attachments

  • 123.jpg
    19.7 KB · Views: 255

DonManfred

Expert
Licensed User
Longtime User
May you guide me How to disable clicking the following buttons?
You can´t disable them
What code should be written to disable them?
You can´t disable them.

For No 1) you can check the keycode in activity keypress and show a messagebox to ask the user if he want to quit the app. But you can not prevent pressing the button at all.
For No 2) and 3) you can not prevent pressing the Button. This is how Android is designed.

You can use Kiosk-App. It will start your app again when pressing 2)
 
Upvote 0

tigrot

Well-Known Member
Licensed User
Longtime User
Hi
I had same problem when building a SOS program, some year ago. I partially solved the problem reactivating the App if some condition put it in backgroud. So home button was not working, since the active app was called in foreground again, and maybe button 3 as well...
 
Upvote 0

sakissoft

Member
Licensed User
Longtime User
Hello,
I need disable the 'display on/off' button(or power button) for 1min and enable button again
How is that done?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…