Sub btnTest_Touch (ViewTag As Object, Action As Int, X As Float, Y As Float, MotionEvent As Object) As Boolean
Private v As View
v = Sender
Select Action
Case Activity.ACTION_DOWN
Time0 = DateTime.Now
Activity.Title = "Down"
Case Activity.ACTION_MOVE
Activity.Title = "Move"
Case Activity.ACTION_UP
Activity.Title = "Up"
If X > 0 And X < v.Width And Y > 0 And Y < v.Height Then
If DateTime.Now - Time0 > LongClickTime Then
ToastMessageShow("Button LongClick", False)
Else
ToastMessageShow("Button Click", False)
End If
End If
End Select
Return True 'Consumes the event
End Sub