Tag Archives: html

4,868 views

xml string with html tags Android

// in strings.xml <string name="myStringWithTags"><![CDATA[<b>some text..</b> other tags …]]></string> <string name="myStringWithPattern"><![CDATA[<b>%s</b> other tags …]]></string> // in Activity.class String sHtmlText = this.getApplicationContext().getString(R.string.myStringTags); sHtmlText = this.getApplicationContext().getString(R.string.myStringWithPattern,"replace %s with this text");

Posted in Android Examples Code | Tagged , , , | Comments Off on xml string with html tags Android
8,302 views

Html List tag in Android TextView – Android sample

Html.fromHtml(String) does not support all HTML tags. For example < ul > and < li > are not supported. Try this source code as a substitute for HTML List Tags. String str = "&bull; Cessnock<br />" +"&bull; Dubbo<br />" +"&bull; … Continue reading

Posted in Android Examples Code | Tagged , | Comments Off on Html List tag in Android TextView – Android sample
3,779 views

How set text to TextView as HTM HTML format Android example

Html.fromHtml(), setText(), textView.setText(Html.fromHtml(String htmlFormat)), Android example. TextView mIdTextOk = (TextView)findViewById(R.id.idTextOk); int _nOk = 57; // number 57 will bold style mIdTextOk.setText(Html.fromHtml( "OK: "+"<b>"+_nOk+"</b>"));

Posted in Android Examples Code | Tagged , , | Comments Off on How set text to TextView as HTM HTML format Android example