Android 检测是否连接蓝牙耳机

 

前言
         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         CSDN:
http://www.csdn.net
         雨季o莫忧离:http://blog.csdn.net/luckkof

正文

  

    private void handleHeadsetStateChange()
    {
     if(BluetoothProfile.STATE_CONNECTED == adapter.getProfileConnectionState(BluetoothProfile.HEADSET))
     {
      Intent intent = new Intent(Intent.ACTION_HEADSET_PLUG);
    sendBroadcast(intent);
     }

 

posted @ 2013-07-05 21:48  坚固66  阅读(1188)  评论(0编辑  收藏  举报