Why does backspace stop working if I set TYPE_TEXT_FLAG_NO_SUGGESTIONS to my AutocompleteTextView?

I have this code:

AutoCompleteTextView et = new AutoCompleteTextView(context); et.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); 

With this code, AutoCompleteTextView prevents the backspace key from working! If I change the class type to EditText, the same behavior will happen.

But the backspace key works with this code:

 AutoCompleteTextView et = new AutoCompleteTextView(context); et.setInputType(InputType.TYPE_CLASS_TEXT); 

I don't need automatic keyboard suggestions, so I'm using AutocompleteTextView! Any suggestions?

I am testing Android 2.3.

+6
source share
1 answer

From what I found, you need to use this instead:

 android:inputType="textNoSuggestions|textVisiblePassword" 

For more information: How can I decline offers in EditText?

+1
source

Source: https://habr.com/ru/post/909654/


All Articles