manager.setMode(AudioManager.MODE_IN_CALL); manager.setSpeakerphoneOn(true);How to disable a headset in Android that I could handle a pressing of button on the headset.
When I call anybody voice transfers to headset but I want that voice transfer to internal dynamic (as usual). I have found application in play market iKey https://play.google.com/store/apps/details?id=com.ligq.ikey that implements it. But I couldn't explain how they do this.
I tried such way but voice is in speaker but I want in internal dynamic(as usual call).
AudioManager manager = (AudioManager).
getSystemService(Context.AUDIO_SERVICE);
manager.setMode(AudioManager.MODE_IN_CALL);
manager.setSpeakerphoneOn(true);