Linkify html content to load it into webview

Viewed 477

I load some html string to a webview and I want to linkify phone numbers, addresses and emails. But if i use Spannable to pass html content into Linkify.addLinks() method all html layout breaks down.

        String htmlText = "<some_html></some_html>";
        SpannableString spannableString = new SpannableString(Html.fromHtml(htmlText));
        Linkify.addLinks(spannableString, Linkify.ALL);
        htmlText = Html.toHtml(spannableString);

So, how to linkify html content before I load it into webview?

1 Answers
Related