Private Sub B4XPage_CloseRequest As ResumableSub
Log("## Close Request ##")
Dim sf As Object = xui.Msgbox2Async("Close?", "Title", "Yes", "Cancel", "No", Null)
Log("run up to here...")
Wait For (sf) Msgbox_Result (Result As Int)
Log("from here down doesn't do anything... xD ")
If Result = xui.DialogResponse_Positive Then
B4XPages.ShowPageAndRemovePreviousPages("Lobby")
Return True
else If Result = xui.DialogResponse_Cancel Then
Return False
else If Result = xui.DialogResponse_Negative Then
Return False
End If
ExitApplication
Return True
End Sub