求助各位大神:我在EditText中插入了一张图片,我用edit_text.getText().toString将图片以String形式保存,我怎么把String又转换为图片显示在TextView中呢?
SpannableString ss = new SpannableString(imagePath);
Pattern p=Pattern.compile("/mnt/sdcard/.+?\\.\\w{3}");
Matcher m=p.matcher(imagePath);
while(m.find()){
Bitmap bm = BitmapFactory.decodeFile(m.group());
Bitmap rbm = r.resizeImage(bm, 100, 100);
ImageSpan span = new ImageSpan(this, rbm);
ss.setSpan(span, m.start(), m.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
Editable edit_text = display.getEditableText();
edit_text.append(ss);
这样做只能得到路径格式的字符串。怎么让图片再显示出来呢?