0

I have a ViewGroup with a click listener, and I can detect clicks easily. But when I add child views with a long click listeners - it "steals" the clicks and prevent the ViewGroup to intercept the short click. So is there an easy way to fix this issue, or I need to go with the dreadful path of interceptTouchEvent stuff.

Uriel Frankel
  • 14,304
  • 8
  • 47
  • 69
  • 2
    Using onInterceptTouchEvent may be easier but you may also try to call `(childView.parent as View).performClick()` in both `onClickListener` and `onLongClickListener` of the child view. – ocos Aug 31 '22 at 10:51
  • @ocos Thank you that's exactly what I did and it works – Uriel Frankel Aug 31 '22 at 11:33

0 Answers0