How can I control a PANIC button on Android?

1.3k views Asked by At

I want to create an application which listens to events from a specific button (hardware button) and triggers some event.

For example, think about a PANIC button function, when some button is kept pressed for 5 seconds, this will trigger some ALERT (suppose sending an sms message).

I have not yet found a way to make this.

Please keep in mind that this MUST BE a HARDWARE BUTTON and not a software button (might in an activity).

Thank you very much.

1

There are 1 answers

4
CommonsWare On

I do not find yet a way to make this.

In your own activity, you can watch for whatever buttons you want via onKeyDown().

Outside of your own activity, what you want is not possible, except via firmware modifications.