Created Wednesday 02 October 2013
When you return a boolean in an event handler method, it determines whether the event is consumed or not.
- If you return true from an ACTION_DOWN event, you are interested in the rest of the events in that gesture. A "gesture" in this case means all events until the final ACTION_UP or ACTION_CANCEL.
- If you return false from an ACTION_DOWN, you do not want the event and other views will have the opportunity to handle it. If you have overlapping views this can be a sibling view. If not it will bubble up to the parent.
In general,
- Any time you return true you tell Android that you want to keep consuming the Gesture
- Any time you return false you tell Android to give another View the opportunity to handle the event.
HOWEVER, none of this applies to a ListView. For a list view, you need to call super.onTouch
Links
No backlinks to this page. comments powered by Disqus