B4J Question map of timers

giggetto71

Active Member
Licensed User
Longtime User
Hi guys,
I have a trivial question (sorry for that..). I came across a nice example from Erel to create timers at runt time based on a list.
B4X:
dim timers as list
Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
      timers.Initialize
      For i = 1 To 10
         Dim t As Timer
         t.Initialize("timer", Rnd(500, 5000))
         timers.Add(t)
         t.Enabled = True
      Next
   End If
End Sub

Sub Timer_Tick
   Log("I'm timer number: " & timers.IndexOf(Sender))
End Sub


I would need a way to use a map instead of a list as I would like to assign a key to the timer when I add it. Is there a way to do that?
thanks!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…