I am trying to connect my USB device to my phone via type-c After creating the connection I get a strange behavior the app opens settings over my app and I have to click back to return my app ..
I am using felHR85:UsbSerial library.
I test it on android version 10
thanks.
try{
usbSerialPort = UsbSerialDevice.createUsbSerialDevice(usbDevice,connection)
if(usbSerialPort != null){
if(usbSerialPort!!.open()){
usbSerialPort?.setBaudRate(BAUD_RATE)
usbSerialPort?.setFlowControl(UsbSerialInterface.FLOW_CONTROL_OFF)
usbSerialPort?.setDataBits(UsbSerialInterface.DATA_BITS_8)
usbSerialPort?.setStopBits(UsbSerialInterface.STOP_BITS_1)
usbSerialPort?.setParity(UsbSerialInterface.PARITY_NONE)
usbSerialPort?.read(callback)
}
}
}catch (e:Exception){
e.printStackTrace()
}