Android: sync system volume seekbar and app seekbar

531 Views Asked by At

I am trying to sync the system volume seekbar with the application seekbar.

System volume seekbar
System volume seekbar.

App volume seekbar
App volume seekbar.

I found a useful link.

Taking over the volume key on Android

Following, I am able to make my app seekbar change whenever users press the volume button.

My questions are:
1/ Is it able to sync the system volume seekbar with the app volume seekbar? I mean when users change the seekbar (not pressing the button), my app volume seekbar also changes too.
2/ If the question 1 is "yes", please show me the way. I found some links which suggest to use registerMediaButtonEventReceiver, but it is already deprecated.

EDIT

Here is what I am doing right now:
1/ I used MediaPlayer to play an audio
2/ I used AudioManager to manage the volume whenever the seekbar change
3/ I used onKeyUp and onKeyDown to detect the action pressing volume button
Thank you in advance!

0

There are 0 best solutions below