Reputation: 3020
Is there a way to detect a click from MotionEvent
s in Android? To be more specific, I need a way to distinct two kind of events: movement and click (I'm more interested in the latter).
For example, this kind of behavior can be observed in MapView
component: if you drag the map just a little - it does not move (I would call this a click), however if movement distance is bigger the map starts to move as well (I would call this movement). Is there a standard threshold (global parameter) or other method to distinct these two actions?
Upvotes: 0
Views: 2306
Reputation: 7410
You can implement an OnGestureListener. onSingleTapUp()
will be called for a click type event and onScroll()
will be called for a movement type event.
Upvotes: 2