Hello,
i've got a question regarding the close/ok button every device app does have in the upper right corner.
My App has two ways to exit out of it.One is through a button and the other one is by use of the menu.I do some cleanup before i really terminate the application.
This looks like this:
If the user pushes the close/ok button, the app just terminates without doing any of my cleanup tasks.
To have the cleanup also done in this case, i just added the following:
This does not work as i expected.I get some excpetion messages related to file access and some (for me ) unpredictable behavior ( infinite loop for instance).Maybe these exceptions have to do with the form1 closure.
- can someone explain, why these exceptions occur..? I ran through the code, but i cannot explain this behavior, even then if i take into account that my form is ( probably ) already closed by the OS..?
-Is there a chance to just catch the close/ok button event without having the OS close the form..?
cheers
TWELVE
i've got a question regarding the close/ok button every device app does have in the upper right corner.
My App has two ways to exit out of it.One is through a button and the other one is by use of the menu.I do some cleanup before i really terminate the application.
This looks like this:
B4X:
Sub Button3_Click
' Quit Button
ExitApp
End Sub
...
Sub Menu5_Click
' Menu Quit
ExitApp
End Sub
...
Sub ExitApp
...
do some clean up
...
AppClose
End Sub
If the user pushes the close/ok button, the app just terminates without doing any of my cleanup tasks.
To have the cleanup also done in this case, i just added the following:
B4X:
Sub Form1_Close
ExitApp
End Sub
This does not work as i expected.I get some excpetion messages related to file access and some (for me ) unpredictable behavior ( infinite loop for instance).Maybe these exceptions have to do with the form1 closure.
- can someone explain, why these exceptions occur..? I ran through the code, but i cannot explain this behavior, even then if i take into account that my form is ( probably ) already closed by the OS..?
-Is there a chance to just catch the close/ok button event without having the OS close the form..?
cheers
TWELVE