Code example for ImageSpan

0
	private void buildEmotion(int start,int end,int resid){
		//根据表情是否正确结束来分类处理 
		Drawable drawable = context.getResources().getDrawable(resid);
//		drawable.setBounds(0, 0, drawable.getIntrinsicWidth()*2, drawable.getIntrinsicHeight()*2); 
		drawable.setBounds(0,0,32,32);
    	ImageSpan is = new ImageSpan(drawable, ImageSpan.ALIGN_BASELINE);
    	spannableSB.setSpan(is, start-offset, end-offset, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
	} 
	 
	/**根据起始位置渲染 @ 
	 * 点击可跳转另一个Activity 
	 * @param start 开始点 
	 * @param start 结束点*/ 
	private void buildAt(int start,int end){
		final String subString = text.substring(start,end);
		OnClickListener listener = new OnClickListener() {
			@Override 
			public void onClick(View v) {
				Toast.makeText(context, "@", Toast.LENGTH_SHORT).show();
//				Intent intent = new Intent(); 
//				intent.setClass(context, com.demo.weibolistdemo.AnotherActivity.class);