前言欢迎大家我分享和推荐好用的代码段~~声明欢迎转载,但请保留文章原始出处: CSDN:
雨季o莫忧离:/luckkof
正文
private void handleHeadsetStateChange(){if(BluetoothProfile.STATE_CONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET)){Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG);sendBroadcast(intent);}