I am creating an Image Cropper Activity. However, my app is not working. I do not know what is the sourceUri and destinationUri means in the builder pattern of the uCrop Library by Yalantis. How can we get or find the sourceUri and destinationUri?
I noticed the contributor in Github said that destinationUri is " where you store the Uri. But how can we get the location to store it? For the sourceUri, I getIntent from another activity to get the imageUri.
I get the imageUri from another activity and I make it as the sourceUri. Please kindly correct me and my mistakes. Thank you very much.
File tempFile = new File (String.valueOf(getIntent().getParcelableExtra("ImageUri")));
File tempCropped = new File(getCacheDir(),"tempImgCropped.png");
Uri sourceUri = Uri.fromFile(tempFile);
Uri destinationUri = Uri.fromFile(tempCropped);
UCrop.of(sourceUri,destinationUri)
//.withAspectRatio(1,1)
//.withMaxResultSize(40,40)
.start(this);
I hope that I can get to know what is the meaning of sourceUri and destinationUri and how to get those Uri.