/*调用拍照返回*/
case PHOTO_REQUEST_GALLERY:
if (data != null) {
Uri uri = data.getData();
String photopath = null;
Cursor cursor = LocationApplication.getContext().getContentResolver().query(uri, null, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
photopath = cursor.getString(cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA));
Log.e("photopath", "photopath:------------" + photopath);
}
/*显示缩略图*/
custom_menu_videos.setVisibility(View.GONE);
custom_menu_yinpin.setVisibility(View.GONE);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;
Bitmap bm = BitmapFactory.decodeFile(photopath, options);
filePath = photopath;
custom_menu_img.setImageBitmap(bm);
rl_photo_scale_all.setVisibility(View.VISIBLE);
custom_menu_img.setVi

这篇博客介绍了Android系统中如何获取拍照后的图片路径,并展示如何回显图片。通过解析 Uri 和查询 MediaStore,获取到照片的本地路径,然后使用 BitmapFactory 解码显示缩略图。同时,文章提到了自定义图片保存路径和处理缩略图的方法,以及在不同Android版本中获取文件路径的注意事项。
最低0.47元/天 解锁文章
4553

被折叠的 条评论
为什么被折叠?



