I have a ListView where each ListItem has a TextView and RatingBar. Initially, the RatingBar is set to invisible. During this time, the onItemClickListener fires correctly. However, when I set the RatingBar visibility to VISIBLE, the onItemClickListener never fires. I saw people with similar checkbox problems that were able to fix their problem by adding:
android:focusable="false"
However, this does not seem to work for the RatingBar. Below is the xml used for the cell:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ratingcelllinear" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="vertical"
android:background="@drawable/cell_bg" android:paddingLeft="10dp"
android:paddingBottom="3dp" android:paddingTop="3dp" android:focusable="false">
<TextView android:id="@+id/ratingcelltitle" android:text="1. First Place"
android:layout_height="wrap_content" android:textColor="#FFFFFF"
android:layout_width="wrap_content" android:ellipsize="end"
android:singleLine="true" android:textSize="22dp" android:focusable="false" />
<RatingBar android:layout_width="wrap_content"
android:layout_height="wrap_content" style="@style/AggievilleRatingBar"
android:numStars="5" android:id="@+id/ratingcellrating"
android:layout_weight="0" android:focusable="false" android:focusableInTouchMode="false" android:clickable="false"/>
</LinearLayout>
source
share