I want to control my android application using volume button which run in phone background all time or not. If i press volume button a certain amount of time (2/3 sec+) in t
check the github: https://github.com/praslnx8/volume_Screen_Lock
They are doing exactly the same.. A service is running to detect the volume button pressing
Solution from that app: start media player in the service with volume 0. While media play is on the media buton action will be recieved at reciever even when the phone is locked