Hi,
I've completed my first app and it works really well. I wanted to add a timer to it that counts up to 60 seconds. I thought that would be an easy feat... But I've no luck so far. I'm NOT an experienced programmer so it's all still new to me..
What I'm trying to achieve here is a counter that counts up to 60 seconds. Once it hits 60 seconds it simulates 2 button clicks.
All that happens when I compile this is that it is stuck on 1....
Where have I gone wrong? Perhaps several places
Countup is declared as Int in Process_Globals.
I've completed my first app and it works really well. I wanted to add a timer to it that counts up to 60 seconds. I thought that would be an easy feat... But I've no luck so far. I'm NOT an experienced programmer so it's all still new to me..
B4X:
Sub Activity_Create(FirstTime As Boolean)
Dim Trial As Boolean
Trial = True
Activity.LoadLayout("Setup")
pw.KeepAlive(True)
If Trial = True Then
Timer1.Initialize("Timer1", 1000)
Timer1.Enabled = True
End If
End Sub
Sub Timer1_Tick
countup=countup + 1
Label3.Text= countup
If countup=60 then
Timer1.Enabled= False
NRotationA_Click
NRotationB_Click
End If
End Sub
What I'm trying to achieve here is a counter that counts up to 60 seconds. Once it hits 60 seconds it simulates 2 button clicks.
All that happens when I compile this is that it is stuck on 1....
Where have I gone wrong? Perhaps several places
Countup is declared as Int in Process_Globals.