onTouch, onLongClick together in android
onTouch
is always called for your view since this is the initial state of dispatching the events to the view. When you long press your view this still calls onTouch
first and since you return true
in onTouch
(which means that you've consumed this event and it should not be further dispatched) you won't get onLongPress
called. What will do the trick is returning false
in onTouch