Android Question Timer1_Tick Not found

Onirzaa

New Member
i cant use timer help me
getting
"An error has occurred in sub :
java.lang.Exception: sub timer_tick was not found,
Contunie?"
sorry for my english
B4X:
Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Dim label1 As Label
    Dim Timer1 As Timer

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("Layout")
    Timer1.Initialize("Timer",1000)
    Timer1.Enabled = True

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub Timer1_Tick
   
    label1.text = "asd"
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
Or change the tick event sub according to your definition
B4X:
Timer1.Initialize("Timer",1000)
' ->
Sub Timer_Tick
    label1.text = "asd"
End Sub
 
Upvote 0
Top