# Displaying HTML tags on TextView the right way

DevFeed: [Displaying HTML tags on TextView the right way](<https://devfeed.tech/articles/displaying-html-tags-on-textview-the-right-way-29030.md>)

Original publisher: [Read original article](<https://saket.me/html-tags-textview/>)

Author: Saket Narayan

Published: 2017-06-29T12:59:12Z

Content type: tutorial

Language: en

Sources: [Saket Narayan](<https://devfeed.tech/sources/saket-narayan.md>)

Topics: [HTML](<https://devfeed.tech/topics/html.md>), [Android](<https://devfeed.tech/topics/android.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [html](<https://devfeed.tech/tags/html.md>), [spans](<https://devfeed.tech/tags/spans.md>), [textview](<https://devfeed.tech/tags/textview.md>)

## AI overview

A tutorial explaining how Android parses and displays HTML in TextView. It compares TextView#setText(), Resources#getString(), Html.fromHtml(), and Html.fromHtml() with CDATA, emphasizing CharSequence and span objects as the mechanisms for rendering styled text.

## Source excerpt

While going through the codebase of a former client, I found that I was using four different ways for showing HTML on Android. This made me realize that I didn't really know what the correct way of showing them is and I've always hammered my way using trial & error until the HTML tags have showed up. Embarrassed, I decided to explore how [...] The post Displaying HTML tags on TextView the right way appeared first on Saket Narayan.