如果我在AutocompleteTextView上设置TYPE_TEXT_FLAG_NO_SUGGESTIONS,为什么退格会停止工作?

mxc*_*xcl 6 android

我有这个代码:

AutoCompleteTextView et = new AutoCompleteTextView(context);
et.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
Run Code Online (Sandbox Code Playgroud)

使用此代码AutoCompleteTextView可防止退格键工作!如果我将类类型更改为EditText,则会发生相同的行为.

但是使用此代码,退格键可以工作:

AutoCompleteTextView et = new AutoCompleteTextView(context);
et.setInputType(InputType.TYPE_CLASS_TEXT);
Run Code Online (Sandbox Code Playgroud)

我不想要键盘的自动建议,这就是我使用AutocompleteTextView的原因!有什么建议?

我正在测试Android 2.3.

nat*_*ome 1

根据我的发现,你需要使用它:

android:inputType="textNoSuggestions|textVisiblePassword"
Run Code Online (Sandbox Code Playgroud)

有关详细信息:如何关闭 EditText 中的建议?