Reputation: 1
I try to implements KeyListener at service, and override onKeyDown method.
but not use above methos...
Upvotes: 0
Views: 1329
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