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