Greetings!
I want to format this HTML into textview:
<p><a href="https://developerfromjokela.com">Attachment</a></p>
I expect <a>
element to be like this:
What I get this instead:
I think problem happens, because:
- Html class can't get links from element's child
Here is my code:
if (message.getContentHtml().split("<p>").length > 2)
messageText.setText(HtmlCompat.fromHtml(message.getContentHtml(), HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_BLOCKQUOTE));
else
messageText.setText(HtmlCompat.fromHtml(message.getContentHtml(), HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_HEADING).toString().trim());
There is this trim because HTML.fromHtml is generating some spaces, and if there is only one row, it can be trimmed to look nice in UI. I tried removing it, but still link is not shown.
Thanks for helping Regards.
? Please remove that duplicate, because you didn't understand my question.
– DFJ May 04 '19 at 19:21element. Do you understand? First image is the same link without being inside
.
– DFJ May 04 '19 at 19:33