I am overriding both onTouch and onClick. Each is supposed to result in different actions (very important). I don't want a touch to be both a touch and a click: it must be either-or. I am not having much luck. How do I get my app to discriminate between onTouch and onClick? Right now, either I get onTouch by itself or I get both onTouch and onClick together (based on whether I change onTouch to return true or false).
Asked
Active
Viewed 81 times
1 Answers
1
An easy solution is to just use onTouch()
. Look for ACTION_UP
and ACTION_DOWN
. Store the position of the touch in ACTION_DOWN
, and in ACTION_UP
if the distance between the touch and the stored touch are < X then fire a custom click event, otherwise fire the drag event.

Samuel
- 16,923
- 6
- 62
- 75
-
Awesome! It just occurred to me to try that. Great minds think alike. I assume it will work. (will let you know if it doesn't). – Cote Mounyo Jul 29 '13 at 17:24
-
Yes, I get you a preemptive check mark. But it does work! Thanks! – Cote Mounyo Jul 29 '13 at 17:50