Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable spell check in TextView

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.

like image 729
Amit Tiwari Avatar asked Mar 15 '16 09:03

Amit Tiwari


1 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?

like image 166
c-an Avatar answered Sep 29 '22 08:09

c-an