I'm typing into an EditText, and logging it like this:
mEditText.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.d(LOG_TAG, Html.toHtml(new SpannableStringBuilder(s)));
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable s) {
}
});
The LogCat output looks like this:
<p dir="ltr"><u>typing stufffff</u></p>
I'm not using an EditText subclass, and I'm not setting any custom styles.
What could be causing the <u> tag to be added?
That tag is a underlined tag. The
EditTextmust be underlined. This is due to the fact that there are Text Suggestions. If you set the inputType using the TextView.setInputType(int) method, or one in a .xml file, you can get rid of the tag.