Android Question Msgbox2Async Hide

Philip Prins

Active Member
Licensed User
Longtime User
Hello
How can i programmaticly hide or dissapear a previous called msg box that is waiting for a result.

Thanks in advance
Philip
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub Globals
   Dim Dialog As JavaObject
End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("1")
   Dialog = Msgbox2Async("Question?", "Title", "Yes", "Cancel", "No", Null, False)
   CloseAfter5Seconds
   Wait For Msgbox_Result (Result As Int)
   Dialog = Null
   If Result = DialogResponse.POSITIVE Then
       '...
   End If
End Sub

Sub CloseAfter5Seconds
   Sleep(5000)
   If Dialog.IsInitialized Then
       Dialog.RunMethod("cancel", Null)
   End If
End Sub
 
Upvote 0
Top