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");
This entry was posted in Android Examples Code and tagged , , , . Bookmark the permalink.


Comments are closed.



5,690 views