worked
worked

Reputation: 5880

Android + When to use onInterceptTouchEvent()?

Sorry if this is vague, but can someone please give me an example of when to use onInterceptTouchEvent()?

I understand the concept, intercepting child view touches in the parent ViewGroup, but why would I need to do tht?

Example usage might help me to better understand it.

Upvotes: 3

Views: 4293

Answers (1)

c0ming
c0ming

Reputation: 3543

When: handler touch event in parent before the event dispatch to the child.

How: create a class extents from ViewGroup(like LinearLayout ...) class and override the onInterceptTouchEvent(), the you can process something you want in the method.

see: the-order-of-click-event-handled-by-parent-view-and-child-view

Upvotes: 2

Related Questions