audioManager.getstreamVolume(AudioManager.STREAM_R

2019-08-10 21:46发布

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条回答
戒情不戒烟
2楼-- · 2019-08-10 22:41

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

audioManager.setRingerMode(ringerMode);
查看更多
登录 后发表回答