https://static.06ms.com/static/images/index/19.jpg

安卓通话免提切换

实现免提开启和关闭,需要添加的权限

/**
 * 免提
 * 
 * @param context
 */
private void toggleSpeaker(Context context)
{
    AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    am.setMode(AudioManager.MODE_IN_CALL);
    am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
}