Android设备读取不到键盘鼠标等usb设备
解决方法
if(Build.VERSION.SDK_INT > 15) { InputManager inptmgr = (InputManager)getSystemService(INPUT_SERVICE); int[] inputs = inptmgr.getInputDeviceIds(); for(int i = 0;i<inputs.length;i++) { String devicename = inptmgr.getInputDevice(inputs[i]).getName(); if(devicename.toLowerCase().contains("mouse")) { } else if(devicename.toLowerCase().contains("keyboard")) { } } }
android - 使用usbManager android看不到鼠标和键盘设备 - IT工具网 (coder.work)
Can't see mouse and keyboard device with usbManager android - Stack Overflow