@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
Uri uri = data.getData();
Cursor cursor = getContentResolver().query(uri, null, null, null,
null);
cursor.moveToFirst();
String imgNo = cursor.getString(0); // 图片编号
String imgPath = cursor.getString(1); // 图片文件路径
String imgSize = cursor.getString(2); // 图片大小
String imgName = cursor.getString(3); // 图片文件名
// Log.e("uri", uri.toString());
ContentResolver cr = this.getContentResolver();
try {
Bitmap bitmap = BitmapFactory.decodeStream(cr
.openInputStream(uri));
ImageView imageView = (ImageView) findViewById(R.id.imview);
/* 将Bitmap设定到ImageView */
imageView.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
// Log.e("Exception", e.getMessage(),e);
}
}
super.onActivityResult(requestCode, resultCode, data);
}