Click is not working on the Listitem Listview android

The first thing what you have to note here is, whenever there are Clickable elements like Buttons or ImageButtons present in your ListView element, they take the control of click events. And so your ListView won’t get the chance to accept the click event.

What you simply have to do is, set the focusable attribute to false for the Button or ImageButton you have in your ListView. But still they will work without any problem and also your ListView’s onListItemClick will also work.

Try this,

        <Button  android:id="@+id/textsize_increaser"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@+id/back_button"
        android:focusable="false"
        android:text=" A + "/>

Here I have added this android:focusable="false" and it works fine. try it.

Leave a Comment