开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜