Code example for Editable

Methods: length, setSpan

0
	public void handleTag(boolean opening, String tag, Editable output, XMLReader xmlReader) {
 
		// TODO Auto-generated method stub 
		if (tag.toLowerCase().equals("mxgsa")) {
			if (opening) {
				sIndex = output.length();
			} 
			else { 
				eIndex = output.length();
				output.setSpan(new MxgsaSpan(), sIndex, eIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
			} 
		} 
	} 
 
	private class MxgsaSpan extends ClickableSpan implements OnClickListener {
		@Override 
		public void onClick(View widget) {
 
			// TODO Auto-generated method stub 
			// 具体代码,可以是跳转页面,可以是弹出对话框,下面是跳转页面 
			mContext.startActivity(new Intent(mContext, MainActivity.class));