I am using SpannableString to style text in an EditText using below
str.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), selectionStart, selectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
str.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), selectionStart, selectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
str.setSpan(new UnderlineSpan(), selectionStart, selectionEnd, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
Which renders the styled text properly as below
hi **hello how are** yiu
hi - normal
hello - bold
how are - bold + italic
yiu - bold + italic + underline
But when I do Html.toHtml(editText.getText()) it returns
h
i
h
o
w
a
r
e
y
ou
Is this expected or am I missing something ? Suggest Please