'Activity module
Sub Process_Globals
Dim timer1 As Timer
End Sub
Sub Globals
Dim buttons As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
timer1.Initialize("Timer1", 1000)
End If
buttons.Initialize
For i = 0 To 4
Dim b As Button
b.Initialize("b")
b.Text = i
Activity.AddView(b, 10dip, 80dip * i, 100dip, 50dip)
buttons.Add(b)
Next
End Sub
Sub Timer1_Tick
Dim i As Int = Rnd(0, buttons.Size)
Dim b As Button = buttons.Get(i)
b.Visible = Not(b.Visible)
End Sub
Sub b_Click
Dim b As Button = Sender
b.Color = Colors.RGB(Rnd(0, 256), Rnd(0, 256), Rnd(0, 256))
End Sub
Sub Activity_Resume
timer1.Enabled = True
End Sub
Sub Activity_Pause (UserClosed As Boolean)
timer1.Enabled = False
End Sub