Use BCToasts; you can set their duration (property: DurationMs) and write a Sleep(SameDuration) after showing them.
B4X:
Dim Toast As BCToast
Toast.Initialize(Root) ' or Toast.Initialize(Activity.As(B4XView)) if your are not using B4XPages.
Toast.DurationMs = 1500
Toast.Show("Message")
Sleep(1500)
Use BCToasts; you can set their duration (property: DurationMs) and write a Sleep(SameDuration) after showing them.
B4X:
Dim Toast As BCToast
Toast.Initialize(Root) ' or Toast.Initialize(Activity.As(B4XView)) if your are not using B4XPages.
Toast.DurationMs = 1500
Toast.Show("Message")
Sleep(1500)
No, because it doesn't raise an event when it completes its "job".
P.S. You could do something like this:
B4X:
Private Sub Button1_Click
Wait For (ShowToast("First toast message", 1500)) Complete(Unused As Boolean)
Wait For (ShowToast("Second toast message", 1500)) Complete(Unused As Boolean)
End Sub
Sub ShowToast(Message As String, Duration As Int) As ResumableSub
Dim Toast As BCToast
Toast.Initialize(Root) ' or Toast.Initialize(Activity.As(B4XView)) if your are not using B4XPages.
Toast.DurationMs = Duration
Toast.Show(Message)
Sleep(Duration)
Return True
End Sub
No, because it doesn't raise an event when it completes its "job".
P.S. You could do something like this:
B4X:
Private Sub Button1_Click
Wait For (ShowToast("First toast message", 1500)) Complete(Unused As Boolean)
Wait For (ShowToast("Second toast message", 1500)) Complete(Unused As Boolean)
End Sub
Sub ShowToast(Message As String, Duration As Int) As ResumableSub
Dim Toast As BCToast
Toast.Initialize(Root) ' or Toast.Initialize(Activity.As(B4XView)) if your are not using B4XPages.
Toast.DurationMs = Duration
Toast.Show(Message)
Sleep(Duration)
Return True
End Sub