I'm using an EditText to write some text. Android's auto-suggest underlines the word, until we hit space. Now, if I enter the word without the space, the resulting text has an underline. It's because I use Html.toHtml(view.getText())
.
Now, there are a few answers I'll be expecting such as disabling auto-suggestion or using view.getText().toString()
, but I need them both. I need the auto-suggestion feature as well as the formatting of the text. An example which solves this problem is the Gmail app. You can write whatever you want in the EditText box and it sends the email without the words being underlined.
Originally Answered: How do I remove the underline feature while typing in Android keyboard ? Goto settings > Language & input > Android Keyboard settings > auto correction > off.
The quickest way to underline text is to press Ctrl+U and start typing. When you want to stop underlining, press Ctrl+U again. You can also underline text and spaces in several other ways.
EditText is used for user input. TextView is used to display text and is not editable by the user. TextView can be updated programatically at any time.
Use this just before you getText(). This is the most straightforward and the official way.
edittext.clearComposingText();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With