Turn on speakerphone whenever an outgoing call is made

后端 未结 2 1118
独厮守ぢ
独厮守ぢ 2020-12-16 06:14

My requirement is to turn on speakerphone whenever an outgoing call is initiated. I tried the following code, but it is not working. In fact, speakerphone turns on when in t

2条回答
  •  一个人的身影
    2020-12-16 06:27

    A similar question was asked and answered here.

    I think the answer may be in your project's AndroidManifest.xml. Try adding:

    uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"
    

    to your manifest, which will allow your app to modify the device's audio settings.
    You will also need to change your audioManager mode to MODE_IN_CALL:

    audioManager.setMode(AudioManager.MODE_IN_CALL)
    

提交回复
热议问题