I found out that if I add code in this next order, it works best for me
audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setMode(AudioManager.MODE_IN_CALL);
audioManager.setSpeakerphoneOn(true);
whereas the following does not work for me if I set SpeakerphoneOn (true) in the first line:
audioManager.setSpeakerphoneOn(true);
audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
audioManager.setMode(AudioManager.MODE_IN_CALL);
source
share