Skip to content

Instantly share code, notes, and snippets.

@MaartenS
Last active February 18, 2016 14:09
Show Gist options
  • Select an option

  • Save MaartenS/16da7ecaec13f8b0663c to your computer and use it in GitHub Desktop.

Select an option

Save MaartenS/16da7ecaec13f8b0663c to your computer and use it in GitHub Desktop.

In order to add a button in a listview you will need to add focusable="false" to the root of the item.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="72dp"
    android:orientation="horizontal"
    android:paddingBottom="8dp"
    android:paddingLeft="16dp"
    android:focusable="false"
    android:paddingTop="8dp">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment