Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

I have this code:

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

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

But with this code the backspace key works:

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

I don't want auto-suggestions from the keyboard, that's why I'm using an AutocompleteTextView! Any suggestions?

I'm testing against Android 2.3.

like image 897
mxcl Avatar asked Feb 29 '12 16:02

mxcl


1 Answers

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

android:inputType="textNoSuggestions|textVisiblePassword"

For more info: How can I turnoff suggestions in EditText?

like image 154
natehome Avatar answered Oct 28 '22 03:10

natehome