Disable spell check in TextView

Viewed 3164

I have many layouts in my app that use TextView to display some sentence fetched from back-end. The problem is, sometimes the text to be displayed contains some words which are not in the english dictionary, so I get a red underline beneath those words. This looks very bad. I have seen other SO posts regarding the same and people suggested to use :

android:inputType="textNoSuggestion"

in the xml of TextView. But, I get a warning from Android Studio that inputType should only be used for EditText or other similar views for input and I guess it is correct.

So, is there any TextView specific attribute that I can use for disabling the spell check? Is there any global setting I can put in the app that disables spell checking, because to refactor each TextView with some attribute seems a lot of work.

4 Answers

Okay, I had the same problem and found out the solution. Add this attribute to your TextView.

android:inputType="textFilter"

if this attribute already set to text then, change it.

Here is my reference: Turn off autosuggest for EditText?

Try this

android:inputType="textNoSuggestions"
Related