79604716

Date: 2025-05-03 12:52:15
Score: 1
Natty:
Report link

I think the best and up-to-date way of doing this is using TextInputLayout from Material Design and set the Style tag as ExposedDropdownMenu

<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
    android:layout_width="250dp"
    android:layout_height="wrap_content"
    android:hint="Hint Text"
    android:orientation="horizontal">
    <AutoCompleteTextView
        android:id="@+id/actv_exposed_dropdown_list"
        android:layout_width="match_parent"
        android:layout_height="61dp"
        android:inputType="none" />
</com.google.android.material.textfield.TextInputLayout>

The result will be like this:
enter image description here

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Adriano Carvalho