I am trying to play a media file and Listening it on Headset, Now I am trying to give a soft button that using for SpeakerOn and Speakeroff.
mAudioManager.setMode(AudioManager.MODE_IN_CALL);
mAudioManager.setSpeakerphoneOn(true);
I have give permission also in Androidmanifest.xml . But on calling these Apis, Mode is changed and using isSpeakerOn() api it showing the speaker status as we expected but In real time I am still getting sound from Headset only not from Speaker?
Give me some guideline so that we can achieve this switching of sound from headSet to Speaker?