### Trap App Exit

To trap App exit, use a callback on the MainForm.
`Sub MainForm_CloseRequest (EventData As Event)
' Your actions
End Sub`
More informationen to be found:
B4J documentation: http://www.b4x.com/b4j/documentation.html
jFX documentation: http://www.b4x.com/b4j/help/jfx.html#form
IDE Event Tips: http://www.b4x.com/android/forum/threads/ide-tips.6546/#content
Example
' Cleaning up a temp file from the app folder when closing the app
`Sub MainForm_CloseRequest (EventData As Event)
' Delete temp file befor closing the app
File.Delete(File.DirApp, "file.tmp")
End Sub`

Changed: , Category: Application, File: T6C159M1190.htm, ID: 1190