Reputation: 11
How can I disable spelling corrections in an EditText's soft-keyboard programmatically in Android? The user can disable it from settings, but I need to disable it in my application.
Upvotes: 1
Views: 1708
Reputation: 862
Android provides a Spell Check service by default.
To disable this service:
For TextView:
android:inputType="textFilter"
For EditText:
android:inputType="textNoSuggestions"
Or programatically in activity:
setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)
If your EditText is multiline:
android:inputType="textMultiLine|textNoSuggestions"
For the android version 8.0 or above :
android:importantForAutofill="no"
textNoSuggestions does not work in every keyboard. So you can check with android:inputType="textVisiblePassword"
or android:inputType="textUri”
.
Upvotes: 1