Skip to content Skip to sidebar Skip to footer

Custom Listview (with Checkbox) Not Responding To Clicks

I've created a custom ListView using my own version of ArrayAdapter. My problem is that it is not responding to any onItemClickListeners. Here are my code snippets: final ArrayAdap

Solution 1:

Set this in your Check-box of custom layout..

 android:focusable="false"
 android:focusableInTouchMode="false"

So your full code will look something like this

 <CheckBox
    android:id="@+id/rowcheckBox1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/rowtext1"
    android:layout_alignBottom="@+id/rowtext1"
    android:layout_alignParentRight="true"
    android:layout_marginRight="26dp"
    android:focusable="false"
    android:focusableInTouchMode="false" 
    android:text="Select this" />

Looks like your check-box is causing this issue...

Solution 2:

Must be sure whenever you performing with Custom ListView and onItemClick event not be triggered you have to set this properties for your custom layout UI elements. So set this for TextView and Checkbox

android:focusable="false"android:focusableInTouchMode="false"

Post a Comment for "Custom Listview (with Checkbox) Not Responding To Clicks"