I am wondering why click events do not bubble if I click inside RecyclerView .
My script uses a simple RecyclerView to show some TextView s, while its parent View has a registered OnClickListener to perform some action if someone clicks on the view. If I click, for example. a TextView event of a click event correctly up to parent. But if I click on RecyclerView , the click will not start bubbling. It is strange that if I install OnClickListener directly on the RecyclerView , it also does not start. I guess this is the root of all evil.
So why is my RecyclerView not getting any click events? Why does the parent not receive click events?
The hierarchy is as follows:
- View (has an OnClickListener) <- Why no clicks? - RecyclerView (clickable=false) - TextView - TextView ....
I experimented with setFocusable() and setClickable() , but with no luck.
PS: My current solution sets OnClickListener for each TextView inside RecyclerView and uses getParent() to distribute the click on the parent view using performClick() manually.
user816328
source share