Unable to turn on speaker phone in call Android

214 Views Asked by At

I am developing a Phone application I want to turn speaker ON/OFF in call. I want to enable and disable the speaker with a button click and I am using the following code. I tried different methods to turn on speakerphone but those are not worked.

     AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(AUDIO_SERVICE);
                audioManager.setMode(AudioManager.MODE_IN_CALL);
                audioManager.setSpeakerphoneOn(true);
0

There are 0 best solutions below