Android Question felUSBSerial

Victor Pavlov

Member
Licensed User
Longtime User
The statement
B4X:
If Not(USBSerial.isInitialized) Then USBSerial.Initialize("USBSerial", MyDevice, -1)
don't work correctly after
B4X:
USBSerial.Close

We get error:
(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'void com.felhr.usbserial.UsbSerialDevice$WorkerThread.setCallback(com.felhr.usbserial.UsbSerialInterface$UsbReadCallback)' on a null object reference

The solution is to use always:
B4X:
USBSerial.Initialize("USBSerial", MyDevice, -1)

Do I make any mistake?
 

DonManfred

Expert
Licensed User
Longtime User
no; Initialize initializes and opens the Serial.
 
Upvote 0
Top