1. Are you ready for the Galaxy S20? Here is everything we know so far!

Foreground service: Can't catch the key press

Discussion in 'Android Development' started by ZenWoR, Jan 11, 2020.

  1. ZenWoR

    ZenWoR Lurker
    Thread Starter

    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 :/


  2. Deleted User

    Deleted User Guest

    Showing a bit of code may allow someone to help you ;)
    Are you using bindService() ?

Share This Page