Hi Guys, been a while since I worked with B4A, just getting back to it to do a simple project and ran into an issue with a Timer that has me scratching my head.
Here is the relevant code
When I test the code above the timer sub fires once and sets the color to some random color but then it does not continue to fire afterwards.
What am I missing here?
Here is the relevant code
B4X:
Sub Process_Globals
Dim Timer1 As Timer
End Sub
Sub Globals
Private Label1 As Label
Private Panel1 As Panel
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("scrMenu")
If FirstTime=True Then
Timer1.Initialize(Timer1_Tick, 250)
Timer1.Enabled=False
End If
Timer1.Enabled=True
End Sub
Sub Timer1_Tick
Panel1.Color= Colors.RGB(Rnd(0, 255), Rnd(0, 255), Rnd(0, 255))
End Sub
When I test the code above the timer sub fires once and sets the color to some random color but then it does not continue to fire afterwards.
What am I missing here?