i want to show a dialog in Activity_KeyPress if the back button was pressed with a msgboxasync and a wait for but i get this error. I was previously doing it with a msgbox result and i wanted to convert it to msgboxasync. isn't it possible?
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
HandleBackKey
Return True
End If
Return False
End Sub
Private Sub HandleBackKey
Msgbox2Async(Message, "Close?", "Yes", "No", "", Null, False)
Wait For MsgBox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
Activity.Finish
End If
End Sub
It is better than showing a modal dialog in the KeyPress event.
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode = KeyCodes.KEYCODE_BACK Then
HandleBackKey
Return True
End If
Return False
End Sub
Private Sub HandleBackKey
Msgbox2Async(Message, "Close?", "Yes", "No", "", Null, False)
Wait For MsgBox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
Activity.Finish
End If
End Sub
It is better than showing a modal dialog in the KeyPress event.