Android - Volume Buttons used in application when phone is locked or sleep mode

前端 未结 1 701
借酒劲吻你
借酒劲吻你 2020-12-11 14:25

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

相关标签:
1条回答
  • 2020-12-11 14:39

    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

    0 讨论(0)
提交回复
热议问题