acacia
acacia

Reputation: 1

how to catch hardware key press event in service(background) on android .?

I try to implements KeyListener at service, and override onKeyDown method.

but not use above methos...

Upvotes: 0

Views: 1329

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006564

Generally, you cannot "catch hardware key press event in service(background) on android".

The CAMERA button, if it exists on a device, and the MEDIA button, if it exists on a plugged-in headset, will result in broadcast Intents if the foreground activity does not consume the events.

Upvotes: 1

Related Questions