EditText without automatic correction, etc.

My EditText should accept input consisting of partial words, names, etc. At least on my HTC Desire, this is difficult, as the keyboard wants to suggest and / or correct some entries (for example, changes to "gor" to "for"). I tried setting textNoSuggestions in the view, but that does not fix it.

Any simple solution to this?

+42
android
Sep 26 '10 at 21:09
source share
3 answers

You can do this from code. Set the input type to EditText as shown below:

txtEmail = (EditText) findViewById(R.id.txtEmail); txtEmail.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); 

For a list of all available input types, see http://developer.android.com/reference/android/text/InputType.html

+51
May 22 '12 at 11:02
source share

Try the following:

 android:inputType="textFilter" 

If this does not work, try:

 android:inputType="textFilter|textNoSuggestions" 
+57
Sep 26 2018-10-22T00:
source share

Other suggestions are true, but SwiftKey decided it would ignore inputtype values ​​"in response to user requests." Although I agree that this is a bad idea, as it contradicts Google’s recommendations, and developers usually have a good reason for disabling automatic correction (e.g. username, last name, etc. fields), this is still the most used keyboard app for Android devices, so this can be a big problem.

The workaround is to use

 android:inputType="textVisiblePassword" 

or

 .setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); 
+22
Jan 10 '14 at 15:01
source share



All Articles