实现免提开启和关闭
需要添加的权限网站模板
【<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>】
01/**
02 * 免提
03 *
04 * @param context
05 */
06private void toggleSpeaker(Context context)
07{
08 AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
09 am.setMode(AudioManager.MODE_IN_CALL);http://www.huiyi8.com/jiaoben/
10 am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
11}