Code example for UsbDevice

Methods: getDeviceName

0
        resolveActivity(intent, matches, defaultPackage, device, null);
    } 
 
    public void deviceDetached(UsbDevice device) {
        // clear temporary permissions for the device 
        mDevicePermissionMap.remove(device.getDeviceName());
 
        Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_DETACHED);
        intent.putExtra(UsbManager.EXTRA_DEVICE, device);
        if (DEBUG) Slog.d(TAG, "usbDeviceRemoved, sending " + intent);
        mContext.sendBroadcast(intent);
    } 
 
    public void accessoryAttached(UsbAccessory accessory) {
        Intent intent = new Intent(UsbManager.ACTION_USB_ACCESSORY_ATTACHED);
        intent.putExtra(UsbManager.EXTRA_ACCESSORY, accessory);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 
        ArrayList<ResolveInfo> matches;
        String defaultPackage;
Contextual code suggestions in your IDE  Get Codota for Java