With Ratingbar (custom icon) in the ListView, the ListView cannot respond to its own click event Onitemclicklistener. What about this?
You only need to set the android:isindicator of Ratingbar in the layout file to False, which means that the ratingbar is only as an indicator and not operable.
There are some situations where we need to customize the ListView to achieve some effect, so at this point we usually encounter a custom listview that cannot select the entire ListViewItem. That is, the Onitemclick () method in the Onitemclicklistener that cannot respond to the ListView
Usually the control that gets the focus by default has all the controls inherited by Button,checkable, which means that if your custom ListViewItem has a button or checkable child control, then the default focus is given to the child control, The ListView item can be selected based on the ability to get focus, which means that we can set the Focusable property to False for all controls contained in the ListView item. In this case, the ListView item automatically gets the focus permission, it can be selected, it will respond to the Onitemclick () method in Onitemclicklistener, however the ListView item The child control of Layout Focusable property set to False is a bit cumbersome, we can set its android:descendantfocusability= by the root control of item layout " Blocksdescendants " so that item layout shields all child controls from getting focus and does not need to reset the Focusable property for each control in item layout, In this way, the Onitenclick () method in Onitemclicklistener can be successfully responded to. For example, each item item of my LISTVIW is relativelayout, then I can set relativelayout android:descendantfocusability= "Blocksdescendants". Note: This property cannot be set to the ListView, nor does it work.
The Ratingbar in the ListView contained in Android cannot respond to click events