iOS Question Msgbox2/waitfor doesn't fire in sub app_background

DickD

Active Member
Licensed User
I need to warn my user that closing the app might interrupt some important processes. I placed a msgbox2/wait for in sub application_background as shown below. But the msgbox doesn't actually appear until you relaunch the closed app. I've also tried this in application_inactive with the same result. How do I fix this?

B4X:
Private Sub Application_Background
Msgbox2("kill","This will stop the process.","Are you sure you want to leave?",Array("Yes","No"))
wait for Kill_click(buttontext As String)
End Sub

Sub Kill_click(Buttontext As String)
If Buttontext = "Yes" Then
    MyService.socket1.close
    MyService.Astream.close
    MyService.Server.close
Else
    Application_Start(NavControl)
End If
End Sub
 

Emme Developer

Well-Known Member
Licensed User
Longtime User
I don't think you can do this in iOS. iOS doesn't use modal dialogs, and msgbox and alertviews (which msgbox is based) don't block code flow
 
Upvote 0
Top