Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim b As Button
Dim r As Reflector
Dim t1, t2 As Long
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
b.Initialize("B")
Activity.AddView(b,0,0,100dip,100dip)
r.Target = b
r.SetOnTouchListener("B_OnTouch")
End Sub
Sub B_OnTouch( viewtag As Object, action As Int, X As Float, Y As Float, motionevent As Object) As Boolean
Select action
Case Activity.ACTION_DOWN
t1 = DateTime.Now
Case Activity.ACTION_UP
t2 = DateTime.Now
Log(t2-t1)
End Select
b.Invalidate
Return True
End Sub