
private void handleHeadsetStateChange(){Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG);if(BluetoothProfile.STATE_CONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET)){intent.putExtra("state", 1);intent.putExtra("microphone", 1…

private void handleHeadsetStateChange() { Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG); if(BluetoothProfile.STATE_CONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET)) { intent.putExtra("state", 1); intent.putExtra("microphone", 1); mContext.sendBroadcast(intent); } else if(BluetoothProfile.STATE_DISCONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET)) { intent.putExtra("state", -1); mContext.sendBroadcast(intent); } }
扫一扫在手机打开
评论
已有0条评论
0/150
提交
热门评论
相关推荐