Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable auto-complete and auto-correct of EditText

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?

like image 447
mamakurka Avatar asked Oct 24 '13 09:10

mamakurka


People also ask

How do you make Edittext read only?

The most reliable way to do this is using UI. setReadOnly(myEditText, true) from this library. There are a few properties that have to be set, which you can check out in the source code.

How do I set autocomplete text on Android?

If you want to get suggestions , when you type in an editable text field , you can do this via AutoCompleteTextView. It provides suggestions automatically when the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.


1 Answers

Try this... Add to your xml.

     android:inputType="textNoSuggestions"
like image 96
Ram Avatar answered Sep 20 '22 18:09

Ram