S Scantech Well-Known Member Licensed User Longtime User May 2, 2019 #1 If decide to use ExitApplication, i have this code that i use in Main Pause Userclosed = true B4X: StopService(ComSerial) StopService(CommunicationRoutine) Sleep(0) ExitApplication 'remove this and test it. Result ** Activity (main) Pause, UserClosed = true ** No wakelock. Sub mnuDisconnect No wakelock. Setting Manager Debug Log ** Service (comserial) Destroy ** ** Service (communicationroutine) Destroy ** No partial wakelock. sending message to waiting queue (sleep) Click to expand... Will sending Message to waiting queue pose an issue? I had to use sleep(0) to allow service to get destroyed.
If decide to use ExitApplication, i have this code that i use in Main Pause Userclosed = true B4X: StopService(ComSerial) StopService(CommunicationRoutine) Sleep(0) ExitApplication 'remove this and test it. Result ** Activity (main) Pause, UserClosed = true ** No wakelock. Sub mnuDisconnect No wakelock. Setting Manager Debug Log ** Service (comserial) Destroy ** ** Service (communicationroutine) Destroy ** No partial wakelock. sending message to waiting queue (sleep) Click to expand... Will sending Message to waiting queue pose an issue? I had to use sleep(0) to allow service to get destroyed.
Erel B4X founder Staff member Licensed User Longtime User May 3, 2019 #2 ExitApplication will not be called. The less things you do in the activity the better. Move this code to a service and it will not be paused. With that said, in most cases it is a mistake to call ExitApplication. Upvote 0
ExitApplication will not be called. The less things you do in the activity the better. Move this code to a service and it will not be paused. With that said, in most cases it is a mistake to call ExitApplication.
S Scantech Well-Known Member Licensed User Longtime User May 3, 2019 #3 Erel said: With that said, in most cases it is a mistake to call ExitApplication. Click to expand... Thanks. I got rid of the ExitApplication Upvote 0
Erel said: With that said, in most cases it is a mistake to call ExitApplication. Click to expand... Thanks. I got rid of the ExitApplication