Press the Up button to close the current page:
How to do this by pressing the back button of the device?
B4X:
Sub Up_Click
B4XPages.ShowPageAndRemovePreviousPages("MainPage")
End Sub