tv1 = (TextView) findViewById(R.id.tv1);
tv2 = (TextView) findViewById(R.id.tv2);
Bitmap bitmap = BitmapFactory.decodeResource(getApplication().getResources(), R.mipmap.ic_launcher);
ImageSpan imgSpan = new ImageSpan(getApplicationContext(), bitmap);
SpannableString spanString = new SpannableString("icon");
spanString.setSpan(imgSpan, 0, 4, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tv1.append(spanString);
tv2.append(spanString);
网友评论