【发布时间】:2013-07-12 23:25:18
【问题描述】:
我正在使用 android 4.2.2,即 API 17,但调用需要 API 级别 12(当前最小值为 8):android.hardware.usb.UsbManager#openDevice
public List<UsbSerialDriver> probe(final UsbManager manager, final UsbDevice usbDevice)
{
if (!testIfSupported(usbDevice, FtdiSerialDriver.getSupportedDevices()))
{
return Collections.emptyList();
}
final UsbDeviceConnection connection = ***manager.openDevice(usbDevice)***;
if (connection == null)
{
return Collections.emptyList();
}
final UsbSerialDriver driver = new FtdiSerialDriver(usbDevice, connection);
return Collections.singletonList(driver);
}
【问题讨论】:
-
如果您打算使用此
manager.openDevice()函数,则将minSDK版本设置为12,请参见此处:developer.android.com/reference/android/hardware/usb/… -
谢谢你,naresh,我明白了,它可以工作了。
标签: android performance android-layout android-intent android-emulator