audioManager.getstreamVolume(AudioManager.STREAM_RING) always returning 0

三世轮回 提交于 2019-12-11 12:35:42

问题


I am trying to get the ring volume, but it always gives 0, regardless of what volume I have set it to (I do this by accessing it via Settings on the phone).

audioManager.getstreamVolume(AudioManager.STREAM_RING) 

The same API works properly with the other audio streams AudioManager.STREAM_NOTIFICATION, AudioManager.STREAM_MUSIC, etc. Could anyone let me know why this is happening and how I can correct it?


回答1:


Your code is correct. The call returns 0 when your phone is in mute or vibration mode. Checkout your ringer mode.

audioManager.setRingerMode(ringerMode);


来源:https://stackoverflow.com/questions/22448654/audiomanager-getstreamvolumeaudiomanager-stream-ring-always-returning-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!