How to remove Android auto-negotiation binding in EditText?

I use EditText to write text. Android auto-declaration of Android underlines the word until we touch the place. Now, if I enter a word without a space, the resulting text has an underline. This is because I use Html.toHtml (view.getText ()).

Now there are several answers that I expect, such as disabling auto-suggestion or using view.getText (). toString (), but I need both of them. I need an automatic suggestion feature as well as text formatting. An example that solves this problem is the Gmail application. You can write whatever you want in the EditText field and it will send an email without underlining the words.

+6
source share
3 answers

Use this just before getText (). This is the easiest and most official way .

edittext.clearComposingText(); 
+8
source

Do it like this:

 android:inputType="text|textNoSuggestions" 
+2
source

I just came up with a solution for this. After sending the text, just hide the keyboard and the text is underlined.

+1
source

Source: https://habr.com/ru/post/989562/


All Articles