2012-01-14 4 views
0

Je reçois des chaînes de service web en code html, et je devais les mettre dans ce code html pour mettre un TextView.Code HTML au format HTML dans Textview

Exemple:

String str = "<b>Hello</b>"; 

// my attempt 
textView.setText(Html.fromHtml(str)); 
// this only convert to <b>Hello</b> instead of running the html code. 

Répondre

4

Eh bien, c'est un truc laid, mais il fonctionne:

textView.setText(Html.fromHtml(Html.fromHtml(str).toString())); 
+0

lol. ça marche –