iOS Question async methods

Albi

Active Member
Licensed User
Hello,

I just need to try to find a work around for no DoEvents in B4i.
I want a toastmessage or a label to show briefly, after selecting an option from a message box. At the moment, the code pauses with the WaitFor routine, but the label/message doesn't show. (Though of course it shows when you step thru the code)
The code I have is

B4X:
lblWrong.Visible = True
WaitFor(1000)
lblWrong.Visible = False
B4X:
Sub WaitFor(Milliseconds As Int)
Dim s As Long
s = DateTime.Now
Do While DateTime.Now < s + Milliseconds
Loop
End Sub
I tried using ToastMessageShow instead of a label, but the same problem occurs.
I'm sure there's a workaround I just haven't yet thought of...
 

Albi

Active Member
Licensed User
The toast message shows, and then almost straight away the message box appears over it, so I was just trying to get it to pause, but i think moving the location on screen of one or the other would help.
So I got rid of the waitFor and just used a label instead of a toastmessage, and put the label to the top of the screen.

Thanks!
 

Albi

Active Member
Licensed User
thanks, I saw that but wasn't and still am not entirely sure what you did there.
 
Top