UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
String deviceName = device.getDeviceName();
Log.d(TAG, "ACTION_USB_DEVICE_DETACHED " + deviceName);
// close our activity if the device it is displaying is disconnected
if (deviceName.equals(mDeviceName)) {
mActivity.finish();
}