我在开发一款应用,需要播放声音和用户交互,但是很多时候用户的手机是静音状态的。
Android有没有接口,可以判断他现在是不是处在静音状态,然后我可以弹出一个提示
他点击一个按钮,就把声音开启
PHPz2017-04-17 11:06:02
Mute means the volume is 0. Use AudioManager to get the current volume and determine whether it is 0.
But there are many types of volume in the Android system: STREAM_VOICE_CALL, STREAM_SYSTEM, STREAM_RING, STREAM_MUSIC, STREAM_ALARM
I think all you need is to check the media volume STREAM_MUSIC
Official documentation: http://developer.android.com/referenc...