本文介绍了HOWTO接收媒体的体积变化通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以注册一个BroadcastReceiver或东西来获得媒体播放器的音量变化的通知?
Is it possible to register a BroadcastReceiver or something to get notifications of media player volume changes?
感谢
推荐答案
立即值,你可以得到,如果你使用AudioManager
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);
在这里audioBroadcastReceiver延伸的BroadcastReceiver,必须在应用程序清单中声明。
where audioBroadcastReceiver extends BroadcastReceiver and must be declared in the application manifest.
不知道这正是你所期待的。
Not sure if this is exactly what you were looking for.
这篇关于HOWTO接收媒体的体积变化通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!