I tried to write the program resembling yours. But I want the COMport be opened just after choosing the item in Combobox. When I push the button btnClose,the COMport closes, but there is an error.
What is wrong?
When I connect the new device, COMport doesnt occur in the list Combobox. I added the button - btnRefresh. When I push it, I refresh the list Combobox. I also have an error. How to correct?
B4X:
java.lang.NegativeArraySizeException
at jssc.SerialNativeInterface.readBytes(Native Method)
at jssc.SerialPort.readBytes(SerialPort.java:437)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:126)
at anywheresoftware.b4j.serial.Serial$1.read(Serial.java:118)
at anywheresoftware.b4a.randomaccessfile.AsyncStreams$AIN.run(AsyncStreams.java:193)
at java.lang.Thread.run(Thread.java:745)
When I connect the new device, COMport doesnt occur in the list Combobox. I added the button - btnRefresh. When I push it, I refresh the list Combobox. I also have an error. How to correct?