0

I implemented a background service for getting the sensor data in the log. i am getting the volume press event in dispatchKeyEvent() method in the activity. But, i want to get the data even though the application is in background.

I tried with BroadcastReceiver.

While click the volume key button, it should trigger a method when the application is in background(like the mediaplayer app increase/decrease the sound).

ADM
  • 20,406
  • 11
  • 52
  • 83
karthik
  • 181
  • 2
  • 3
  • 10
  • Try this link https://stackoverflow.com/questions/55829791/how-to-syncronize-system-volume-with-mediaplayer-app/55829839#55829839 – Mayur May 22 '19 at 12:15
  • Mayur ,I don't want to increase the volume. i wanted to detect the key press. – karthik May 22 '19 at 12:26

0 Answers0