howto receive media volume change notifications?
I开发者_如何学Pythons it possible to register a BroadcastReceiver or something to get notifications of media player volume changes?
Thanks
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.
精彩评论