I am facing a weird issue:
My source string for Html.fromHtml() is as follows:
<strong>Terrible experience with Nikko hotel</strong><br />It was not easy to cancel booking. I called to cancel books, but they still chraged us two full days. A reason was we were late ten minutes in calling to cancel. They explained us very kindly that I can only cancel the first day. But they charged after then.\nSick."
which is retrieved from a json response
Now, when I display it using setText as follows:
commentbox.setText(Html.fromHtml(cmnt.getString("cmnt")));
but the output which i see is as follows:
Why is it giving me italic text instead of bold?
This can be a LIMITATION as described here:
the Html.fromHtml() method in Android that creates a SpannedString from HTML source flips <em>
and <strong>
tags, so what you might be used to seeing in boldface turns into italics and vice-versa. This should only be an issue if you are displayng the generated HTML in a TextView — WebView in particular should behave more normally.
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