1

Our company's name always comes up as misspelled (the red underline) when typed into EditText fields in our app. Is there a way I can disable the misspelling flag for a specific word to avoid this nagging feature?

And before someone suggests android:inputType="textNoSuggestions", I would still like spellcheck to be available to that specific field, and only exclude our company name.

nipponese
  • 2,813
  • 6
  • 35
  • 51

1 Answers1

0

I have no idea if it'll work, but you can try putting android.text.style.LocaleSpan over each occurrence of the company name, using Locale.ROOT (which has no language) as the target locale.

(Most of the time you encounter a CharSequence in a text view it can be cast to Spannable. If it can't, just copy its contents into a SpannableStringBuilder.)

Barend
  • 17,296
  • 2
  • 61
  • 80