How to capture key events inside a service?

后端 未结 5 2036
天命终不由人
天命终不由人 2021-01-05 12:51

I want to be able to capture key events inside a service I am writing. I can do this inside an activity without problems, but all my attemps to get this working in a service

5条回答
  •  无人及你
    2021-01-05 13:18

    If you just want to capture the event of changing volume regardless of volume button is pressed or not, this answer would helpful.

    any way to detect volume key presses or volume changes with android service?

提交回复
热议问题