Android asks for USB permission twice

折月煮酒 提交于 2021-02-07 18:27:26

问题


I have a dev board running Android 4.0.4 and am using it as a USB accessory. When I close the application on the board then plug in an Android phone over USB the board prompts "Open AppName when this USB device is connected?". When I touch OK, the application launches and the popup is shown again, and it's also shown on the phone this time (but says accessory instead of device).

I am also noticing that when I plug in the device I receive the action android.hardware.usb.action.USB_DEVICE_DETACHED before I receive android.hardware.usb.action.USB_DEVICE_ATTACHED, which seems like very strange behavior.

I can provide more details but I'm not entirely sure what would be helpful for debugging. My question: What is causing this behavior?

来源:https://stackoverflow.com/questions/20790383/android-asks-for-usb-permission-twice

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!