Listen to volume buttons in background service?

android, listen, volume

Solution

Judging by the couple of other questions about this topic, no.

Other question 1, Other question 2

Services simply do not receive KeyEvent callbacks.

Problem

I know how to listen to volume buttons in an activity. But can I do that in a background service? If yes, how to do that?

Original source

Related problems