I
I
Igor2015-11-18 15:30:23
Android
Igor, 2015-11-18 15:30:23

How to combine onInterceptTouchEvent on the parent and onClickListener on the children?

There is an ExpandableListView with the Drag-n-Drop function (for which onInterceptTouchEvent and touchHandler are used) and the descendants in the adapter have OnClickListeners for buttons inside each list element.
If I write in onInterceptTouchEvent - return true; then touchHandler works on all events and drag-and-drop works, but clicks on buttons inside list elements do not work. If I remove return true and leave return super.onInterceptTouchEvent , then button clicks work fine, but Drag-n-Drop does not work because ACTION_DOWN does not come to touchHandler.
How to be? you need both Drag-n-Drop and clicks.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question