Sub Process_Globals
Dim tmr As Timer
End Sub
Sub Globals
Dim b As Button
Dim l As EditText
Dim ctr As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
b.Initialize("b")
Activity.AddView(b, 0, 0, 50%x, 20%y)
b.Text = "click me"
l.Initialize("")
Activity.AddView(l, 0, 30%y, 100%x, 20%y)
If FirstTime Then
tmr.Initialize("tmr", 500)
End If
ctr = 0
l.Text = ctr
End Sub
Sub tmr_Tick
ctr = ctr + 1
l.Text = ctr
End Sub
Sub b_Down
tmr.Enabled = True
End Sub
Sub b_Up
tmr.Enabled = False
End Sub