5

Is it possible to register a BroadcastReceiver or something to get notifications of media player volume changes?

Thanks

acurtis
  • 151
  • 2
  • 7

1 Answers1

5

Immediate value you can get if you use AudioManager

AudioManager mAudioManager = Context.getSystemService(Context.AUDIO_SERVICE);
mAudioManager.getStreamVolume(STREAM_MUSIC);

The only function that gives you opportunity to register broadcast receiver is

mAudioManager.registerMediaButtonEventReceiver(audioBroadcastReceiver);

where audioBroadcastReceiver extends BroadcastReceiver and must be declared in the application manifest.

Not sure if this is exactly what you were looking for.

Zelimir
  • 11,008
  • 6
  • 50
  • 45