public boolean isAvailable() {
   if (isEnabled()) {
     return bluetoothHeadset != null && bluetoothHeadset.getConnectedDevices().size() > 0;
   } else {
     return false;
   }
 }
 public void startVoiceRecognition() {
   // BluetoothDevice btDevice = bluetoothHeadset.getConnectedDevices().get(0);
   // List<BluetoothDevice> list =
   bluetoothHeadset.getConnectedDevices();
   /*if(list != null) {
       Toast.makeText(appContext, "Number of devices" + Integer.toString(bluetoothHeadset.getConnectedDevices().size()),
               Toast.LENGTH_LONG).show();
   }else{
       Toast.makeText(appContext, "Number of device is null",
               Toast.LENGTH_LONG).show();
   }*/
   // bluetoothHeadset.stopVoiceRecognition(btDevice);
   // bluetoothHeadset.startVoiceRecognition(btDevice);
 }
 public void stopVoiceRecognition() {
   if (bluetoothHeadset.getConnectedDevices().size() > 0) {
     BluetoothDevice btDevice = bluetoothHeadset.getConnectedDevices().get(0);
     bluetoothHeadset.stopVoiceRecognition(btDevice);
   }
 }