I have been replacing all the Msgbox & Msgbox2 calls in my apps with MsgboxAsync & Msgbox2Async calls. After reading Erel's tutorial, I came to the conclusion that for a MsgboxAsync call, there is not necessarily a requirement to use a Wait For Msgbox_Result if there isn't any code after the dialog that you want to hold off executing until the dialog has been dismissed.
So, with this in mind I implemented the following sub:
This sub is called from an Activity menu item, so is run pretty much in isolation - therefore I figured that the Wait For would be not required - but in testing, I discovered that it will crash every time when the OK button is tapped. This is the error I get in the debug log:
Any ideas why?
- Colin.
So, with this in mind I implemented the following sub:
B4X:
Sub mnuAbout_Click
Private sMsg As String
sMsg = "myPets v" & Get_Version & CRLF & CRLF & _
"Copyright (c) 2015-2017 Computersmith" & CRLF & CRLF & _
"Icons created by Freepik (www.freepik.com)"
MsgboxAsync(sMsg, "About myPets")
End Sub
This sub is called from an Activity menu item, so is run pretty much in isolation - therefore I figured that the Wait For would be not required - but in testing, I discovered that it will crash every time when the OK button is tapped. This is the error I get in the debug log:
If I put in a Wait For, it no longer crashes.An error occurred:
(Line: 1062) End Sub
java.lang.Exception: Sub msgbox_result signature does not match expected signature.
public static void com.airlinemates.mypets.main_subs_1._msgbox_result() throws java.lang.Exception
Any ideas why?
- Colin.