0

In my Androdi App, i am using a AutoCompleteTextView. Iam using ArrayAdapter to set the suggestions. Now, I want the user to select only from the suggestions dropdown and not allow the user to input any free text.

Amrutha Desai
  • 101
  • 3
  • 15
  • Does this answer your question? [Android: Restrict user from selecting other than autocompletion suggestions?](https://stackoverflow.com/questions/13394054/android-restrict-user-from-selecting-other-than-autocompletion-suggestions) – Thelouras Mar 20 '21 at 12:20
  • Alternative: What about using a spinner? That's the main function of that element. – javdromero Mar 20 '21 at 13:57
  • @javdromero Unfortunately Material Components for Android seems to have forgotten about spinners and wants you to use non-editable [exposed dropdown menus](https://material.io/components/menus/android#exposed-dropdown-menus) instead. – stevesw Jun 12 '22 at 22:15

2 Answers2

2

Use FocussableInTouchMode as false and cursorVisibile as false

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 08 '23 at 00:22
1

android:inputType="none"

Moeshin
  • 71
  • 1
  • 3