Code example for ImageSpan

	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); 
    	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() {
			public void onClick(View v) {
				Toast.makeText(context, "@", Toast.LENGTH_SHORT).show();
//				Intent intent = new Intent(); 
Connect your IDE to all the code out there  Get Codota for Java