Hi , this is my implemention
caller :
Intent intent = new Intent(activity.getApplicationContext(), ImageCropperActivity.class);
intent.setData(imageUri);
activity.startActivityForResult(intent, requestCode);
cropper activity:
Intent intent = getIntent();
imageUri = intent.getData();
imgCropper.setImageUriAsync(imageUri);
imgCropper.setOnCropImageCompleteListener(this);
perform crop:
imgCropper.getCroppedImageAsync();
now in onCropImageComplete the result.getUri() is null, where is problem?
I changed
imgCropper.getCroppedImageAsync();
to
imgCropper.saveCroppedImageAsync(Uri.fromFile(new File(SAVE_PATH)));
and problem solved, now in the setOnCropImageCompleteListener the result.getUri() is not null.
@ArthurHub I think it's better to write wiki more accurate, regards
If you look at the source code it says exactly what you did.
` /**
* The Android uri of the saved cropped image result Null if get cropped image was executed, no
* output requested or failure.
*/
public Uri getUri() {
return mUri;
}`
Most helpful comment
I changed
to
and problem solved, now in the setOnCropImageCompleteListener the result.getUri() is not null.
@ArthurHub I think it's better to write wiki more accurate, regards