Skip to content

Instantly share code, notes, and snippets.

@gnuton
Created June 4, 2013 07:36
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnuton/5704247 to your computer and use it in GitHub Desktop.
Save gnuton/5704247 to your computer and use it in GitHub Desktop.
Android: How to display rich text in a textView
TextView tv = (TextView)findViewById(R.id.mytextview);
Spanned myStringSpanned = Html.fromHtml(myString, null, null);
tv.setText(myStringSpanned, TextView.BufferType.SPANNABLE);
Supporte TAGS on Android 2.1
<a href="...">
<b>
<big>
<blockquote>
<br>
<cite>
<dfn>
<div align="...">
<em>
<font size="..." color="..." face="...">
<h1>
<h2>
<h3>
<h4>
<h5>
<h6>
<i>
<img src="...">
<p>
<small>
<strike>
<strong>
<sub>
<sup>
<tt>
<u>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment