1,MtpDevice.getDeviceInfo()为空
因为MtpDevice.open(usbconnection)//为false 或者根本没有执行
2,MtpDevice.getStorageIds() int[]为空
可能时因为Manifest中缺少权限
<uses-permission android:name="android.hardware.usb.host"/>
3,UsbManager.openDevice(usbDevice)无法执行完毕,阻塞了。
建议所有的连接操作都放在子线程中,在主线程中控制子线程,超时中断,重来。
网友评论