Dim csu As CallSubUtils
csu.CallSubDelayedPlus(Me,DisMessage(1),10000)
csu.CallSubDelayedPlus(Me,DisMessage(2),5000)
csu.CallSubDelayedPlus(Me,DisMessage(3),400)
but the three message display in same time,and disappeared same time
like the delay time is no used
I need you help
I post all zip file
thank you for all
You are not using CallSubUtils correctly.
1. Initialize it in Application_Start and don't dim it again.
2. You need to pass the sub name. Your code directly calls the sub.
B4X:
Sub Button1_Click
csu.CallSubDelayedPlus2(Me, "DisMessage" ,400, Array("First Message"))
csu.CallSubDelayedPlus2(Me, "DisMessage" ,5000, Array("Second Message"))
End Sub
Private Sub DisMessage(args() As Object)
hd.ToastMessageShow(args(0),True)
SetHUDOffset(Page1.RootPanel.Height / 2 - 100) 'note that RootPanel height will be 0 in Application_Start
End Sub
Thanks Erel
I change code like you post,It's display fine, the "First Message" disappeared and the "Second Message" will display in the same site.
and I change it
B4X:
Sub Button1_Click
csu.CallSubDelayedPlus2(Me, "DisMessage" ,400, Array("First Message"))
csu.CallSubDelayedPlus2(Me, "DisMessage" ,5000, Array("Second Message"))
End Sub
Private Sub DisMessage(args() As Object)
hd.ToastMessageShow(args(0),True)
If args(0)="First Message" Then
SetHUDOffset(Page1.RootPanel.Height / 2 - 100) 'note that RootPanel height will be 0 in Application_Start
else if args(0)="Second Message" Then
SetHUDOffset(Page1.RootPanel.Height / 2 - 200)
End If
End Sub
It's so cool.
and thank you again
I have a question, Two or more ToastMessageShow can't show the same time, and disappeared not at the same time.