android使用google ADK开发无法识别设备的问题

hello_java_ hello_java_ 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
想用Google ADK来进行开发,用如下代码检测是不是有设备连接进来,但是不管用什么设备好像都没有反应。这是为什么呢。求高手能够告知一下,感激不尽啊。。
String content = new String();
content += "begin..........";
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
while(deviceIterator.hasNext()){
UsbDevice device = deviceIterator.next();
content += device.getDeviceName();
}
content += "end............";
关于权限的android.hardware.usb.host.xml已经有了
handheld_core_hardware.xml里也添加了<feature name="android.hardware.usb.host" />
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
hello_java_
Android 80,490 成员 91,371 内容