be kind this is my first post.
I have a Crop intent retuning and assigning the Bitmap to an ImageView. But what i want is the URI of the new bitmap.
How can i either get the Uri from the ‘photo’ var, or return the URI with the intent result.
protected void onActivityResult(int requestCode, int resultCode, Intent data)
case CROP_FROM_CAMERA:
Log.d(TAG, "Returned from Crop");
Bundle extras = data.getExtras();
Uri uriCropped = data.getData();
if (extras != null) {
Bitmap photo = extras.getParcelable("data");
Log.d(TAG, "Setting Crop preview with URI: " + uriCropped);
ImageView mImageView2 = (ImageView) findViewById(R.id.mImageView);
mImageView2.setImageURI(uriCropped);
}
File f = new File(mImageCaptureUri.getPath());
if (f.exists()) f.delete();
startX(<URI of 'photo' needed>);
break;
Thanks in advance.
Your
photovar only exists in memory and therefore it doesn’t have a Uri. In case you need the Uri save it to the device storage and retrieve it with Uri.fromFile(File file).