我有一个ImageView
其中图库选择的图像需要设置,但是当我选择相机文件夹图像时,所选图像未在ImageView
中设置。将图像设置为从相机文件夹中的图像
if (requestCode == REQUEST_PICK_IMAGE_FROM_GALLERY) {
Uri selectedImg = data.getData();
String[] filePath = {MediaStore.Images.Media.DATA};
Cursor c = getActivity().getContentResolver().query(selectedImg, filePath, null, null, null);
c.moveToFirst();
int columnIndex = c.getColumnIndex(filePath[0]);
String picturePath = c.getString(columnIndex);
bitmap = BitmapFactory.decodeFile(picturePath,options);
mUserProfileImage.setImageBitmap(bitmap);
}
嗨devcelebi,是“数据”返回onActivityResult数据和什么是“ExifInterface”和“C”?感谢您的快速回复。 –
orientation.c的Exifinterface是文件的名称。如果您不需要方向控制,则不会写入exif.You可以尝试在此代码中使用bitmapfactory.options – devcelebi