8

I would like to disable auto-complete and auto-correct in my editText field. I found this solution which disabled everything:

this.setInputType(this.getInputType() | EditorInfo.TYPE_TEXT_FLAG_NO_SUGGESTIONS
            | EditorInfo.TYPE_TEXT_VARIATION_FILTER);

That is fine but now I need to change my keyboard from normal alpha numeric to email. Unfortunatelly function above removes this option. When I remove parameter EditorInfo.TYPE_TEXT_VARIATION_FILTER, I can set an email keyboard but auto-complete is back as well.

How can I disable auto-correct/complete and have email keyboard at the same time?

4

2 回答 2

8

试试这个... 添加到您的 xml。

     android:inputType="textNoSuggestions"
于 2013-10-24T09:15:32.793 回答
4

将此行添加到您的 EditText 中。

android:inputType="textFilter" 

这是一个提示。如果您希望能够使用“回车”键,请使用此行。

android:inputType="textFilter|textMultiLine"

也检查这个链接:

Android以编程方式禁用模拟器中EditText的自动完成/自动建议

于 2013-10-24T09:11:46.310 回答