3

I am working on an application that is handling incoming and outgoing calls. I am able to handle Incoming and outgoing calls Successfully using Telephony manager.

The issue what i am facing here is Turn Speaker Phone on and off is not working properly only for Samsung S3 and Nexus Devices(Speakers is turning on with Noise). It is working good in Samsung Duos and Micromax.

Please tell me is there any additional code i need to use to make it work.

audioManager.setMode(AudioManager.MODE_IN_CALL);    


if (audioManager.isSpeakerphoneOn()) {
    audioManager.setSpeakerphoneOn(false);
} else {
    audioManager.setSpeakerphoneOn(true);
}
InnocentKiller
  • 5,234
  • 7
  • 36
  • 84

1 Answers1

1

Do not change mode of audioManager.

i.e. remove line :- audioManager.setMode(AudioManager.MODE_IN_CALL);

If you change mode of audio manager then you need to restore it to previous mode also after ending a call.

maveroid
  • 1,840
  • 1
  • 20
  • 20