1,MtpDevice.getDeviceInfo()為空
因為MtpDevice.open(usbconnection)//為false 或者根本沒有執(zhí)行
2,MtpDevice.getStorageIds() int[]為空
可能時因為Manifest中缺少權(quán)限
<uses-permission android:name="android.hardware.usb.host"/>
3,UsbManager.openDevice(usbDevice)無法執(zhí)行完畢,阻塞了。
建議所有的連接操作都放在子線程中,在主線程中控制子線程,超時中斷,重來。