Android programmatically disable autocomplete/autosuggest for EditText in emulator

For Vodafone 845 (2.1), huawei 8800 (2.2) devices, textVisiblePassword seems to prevent word prediction.

vendorId.setInputType(android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);

or

android:inputType="textVisiblePassword"

[Edit] this answer is quite old and I don't have the environment anymore to test to get up-to-date info for comments here, sorry.


In the layout XML, add the following attribute to your EditText:

android:inputType="text|textNoSuggestions"

If neither this, nor the above approaches work, then this is almost certainly a problem with the emulator and the other device, and you should contact the manufacturers directly.

See also: android:inputType (note that EditText is a subclass of TextView, which is why this attribute also works for EditTexts).


I've tried all the above and none of above really helped me. I've search through available InputTypes and I've came up with a solution, which happened to be TYPE_TEXT_FLAG_AUTO_COMPLETE:

mEditText.setInputType(InputType.TYPE_TEXT_FLAG_AUTO_COMPLETE);

From its description:

This generally means that the input method should not be showing candidates itself, but can expect for the editor to supply its own completions/candidates from InputMethodSession.displayCompletions().

I haven't specified any completions set and as a result I'm not getting any auto-suggestions.

PS. Flag InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD mentioned in commend above does this trick as well, but it also disables toggling the language in the keyboard.