setRingerMode during incoming call - RINGING

独自空忆成欢 提交于 2019-12-03 21:27:36
guyland123

I don't think there is anything you can do to overcome the 1/2 sec delay before you mute the ringer. Sometimes it works (ie very short or no delay), sometimes you will hear the ringer for a short period of time.

I think the problem you are having is with the flags passed to setStreamVolume.

Try this:

amanager.setStreamVolume(AudioManager.STREAM_RING, 7,
    AudioManager.FLAG_SHOW_UI|AudioManager.FLAG_PLAY_SOUND);

You should be using the bitwise inclusive or (|), and not simple addition (+).

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