Code example for SpannableStringBuilder

Methods: toString

0
                		ds.setColor(anchorColor);//字体颜色
                	    ds.setUnderlineText(isAnchorUnderline); //下划线
                	} 
					@Override 
					public void onClick(View widget) {
						listener.onClick(Uri.parse(url.getURL()), newStyleText.toString());
					} 
				}, sp.getSpanStart(url),sp.getSpanEnd(url),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);   
            }    
        } 
        tv.setText(newStyleText);
	} 
	 
	public static void formatHtmlWithImage(final Context ctx, final TextView tv, String replaceStr, int resId){
		Spanned spd = Html.fromHtml(tv.getText().toString());
		CharSequence text = spd;
		//设置可点击 
		tv.setMovementMethod(LinkMovementMethod.getInstance());
		//新建样式 
		final SpannableStringBuilder newStyleText=new SpannableStringBuilder(text);   
		//超链接处理