Hello everyone,
I've developed a UI-program which calls the Mainform_Closed sub on clicking the X. It then kills the MQTT-connection and saves my collected data. So far, so good.
But if I start it in Release mode (or use the jar-file to start it), the process Java(TM) Platform SE binary keeps running, the only way to kill it I can find is by using the task manager and do it manually. (If I re-run my code in Debug mode it tells me it cannot start because my jar-file is being used by another process)
Is there any way to kill that process automatically on closing the mainform?
Here's the code:
I've developed a UI-program which calls the Mainform_Closed sub on clicking the X. It then kills the MQTT-connection and saves my collected data. So far, so good.
But if I start it in Release mode (or use the jar-file to start it), the process Java(TM) Platform SE binary keeps running, the only way to kill it I can find is by using the task manager and do it manually. (If I re-run my code in Debug mode it tells me it cannot start because my jar-file is being used by another process)
Is there any way to kill that process automatically on closing the mainform?
Here's the code:
B4X:
Sub MainForm_Closed 'Methode, die beim Schließen des Applikationsfensters aufgerufen wird.
mqtt.Close 'MQTT-Verbindung wird beendet
Log("mqtt closed")
SaveFiles(table_max,"temp_max.csv",temp_max,True) 'Alle Werte aus den drei Listen werden in je einer CSV-Datei gespeichert.
SaveFiles(table_min,"temp_min.csv",temp_min,False) 'Dabei werden evtl. bereits bestehende Werte überschrieben.
SaveFiles(table_moist,"moisture.csv",moist_max,True)
Log("gespeichert")
End Sub