在EditText和TextView中插入图片主要用到SpannableString
SpannableString ss = new SpannableString("pic");
Drawable d = getResources().getDrawable(R.drawable.icon);
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);
ss.setSpan(span, 0, ss.length(),Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
typeEditText.append(ss);