TextView vs Button for Android AlertDialog I want to open an AlertDialog on the click of either a Button or TextView but I am not sure what would work best. When a selection is made in the AlertDialog, I want the bottom text to be updated with the selection. Here are the two options I have:

TextViews only. Here, the LinearLayout will have listener and will open AlertDialog.

&lt;LinearLayout
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:orientation="vertical"&gt;

    &lt;TextView
        android:id="@+id/label"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Label" /&gt;

    &lt;TextView
        android:id="@+id/selection"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="5dp"
        android:layout_marginStart="5dp"
        android:textSize="18sp"
        android:text="Select..." /&gt;

&lt;/LinearLayout&gt;


TextView and Button. Here, the Button will open the AlertDialog and the text inside the Button will be replaced with the selection.

&lt;TextView
    android:id="@+id/label"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dp"
    android:layout_marginLeft="5dp"
    android:layout_marginStart="5dp"
    android:text="Label"
    android:textSize="16sp"
    android:textColor="@android:color/white" /&gt;

&lt;Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/label"
    android:layout_marginTop="-20dp"
    android:text="Select..."
    android:textAllCaps="false"
    android:textColor="@android:color/white"
    android:gravity="start|center_vertical"
    android:paddingLeft="15dp"
    android:paddingStart="15dp"
    android:paddingRight="15dp"
    android:paddingEnd="15dp"
    android:paddingTop="15dp"
    android:textSize="18sp"
    android:background="@android:color/transparent" /&gt;
Answer is Button.

Button is a subclass of TextView. So it has all the features of TextView and additional features of Button class. Button adds a few stylistic changes (e.g., default background image, additional padding, ripple effect) to allow quicker adaptation to your designs.