@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.editnote);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_edit);
setSupportActionBar(toolbar);
EditText editText = (EditText)findViewById(R.id.edit_content);
String imagePath = getIntent().getBundleExtra("neirong").getString(
"nei");
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 = resizeImage(bm, 100, 100);
ImageSpan span = new ImageSpan(this, rbm);
ss.setSpan(span, m.start(), m.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
editText.setText(ss);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
InitView();
}
对应如上代码,resizeImage方法该怎么写?