Android Question Display Timer current time value as ProgressBar

hub73

Active Member
Licensed User
Longtime User
Hello.
I'm searching a way to display a Timer ellapsed time into a Progress bar.

For example

My.Initialize ("My_timer", 2000)
MyTimer.Enabled = True

The progress bar should display the time 0 to 2000 millisecs. (0% at 0 ms, 100% at 2000 ms )

Many thanks for your help.
 

DonManfred

Expert
Licensed User
Longtime User
Your timer will fire ONCE each 2000 ms...
There is nothing to display in a progress using this timer
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Hello.
I'm searching a way to display a Timer ellapsed time into a Progress bar.

Try this .. define a global variable , ProgressCount

B4X:
Timer1.Initialize("Timer1",100)
Timer1.Enabled = True

Sub Timer1_Tick   
   
    If ProgressCount < 100 Then
        ProgressCount = ProgressCount + 5
        ProgressBar1.Progress = ProgressCount       
    Else
        Timer1.Enabled = False
    End If
   
End Sub

 
Upvote 0
Top