I have a ListView
item layout that is using a HorizontalScrollView
in the center. I have used the android attribute "android:descendantFocusability="blocksDescendants"
" on my parent LinearLayout
so that the ListView
items are still selectable.
The problem I am having is that when clicking the part of the ListView
item which is the HorizontalScrollView
, the ListView
item click event is not called.
How can I get the click event of the HorizontalScrollView
to call the ListView
list item click event?
HorizontalScrollView doesn't have "onClick()", see this http://developer.android.com/reference/android/widget/HorizontalScrollView.html
It support gestures and have "onTouchEvent(MotionEvent ev)"
So you can use it as click. See followin demo which I hav prepared.
Adding boolean variables touchDown and touchUp to the adapter class as follows seems to work fairly well:
It's far from perfect, but should work for most standard use-cases