• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Foreground service: Can't catch the key press

ZenWoR

Lurker
I want to catch the key press in my service (for example Volume up key) and print a message in console. It should work when app is open or closed.
I used dispatcherKeyEvent() but that works only for activity.
If anyone can help me, thank you in advance, I don't have much time :/
 
Showing a bit of code may allow someone to help you ;)
Are you using bindService() ?
 
Back
Top Bottom