我正在使用https://developer.android.com/guide/topics/connectivity/usb/host.html
中的示例getDeviceList()为空
实例化UsbManager
UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);
HashMap<String, UsbDevice> deviceList = mUsbManager.getDeviceList();
Log.e("usb manager", deviceList.toString());
Manifet文件
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
/>
</intent-filter>
<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.hardware.usb.host"/>