Code example for SpannableStringBuilder

Methods: insert

0
		return starttag.length() + endtag.length();
	} 
 
	private int insertHTMLAndFixSpans(String html, int startoffset,
			SpannableStringBuilder ssb) {
		ssb.insert(startoffset, html);
		return html.length();
	} 
 
	private int insertImgsAndFixSpans(String imgsrc, int startoffset,
			SpannableStringBuilder ssb) {
		String html = "<img src = \"" + imgsrc + "\"/>";
		ssb.insert(startoffset, html);
		return html.length();
	} 
 
	public Spannable XHTMLToSpannable(CharSequence xhtml) {
		new SpannableStringBuilder();
		for (int i = 0; i < xhtml.length(); i++) {
			char ch = xhtml.charAt(i);
			if (isTagCharacter(ch)) {