the code for crop
mCropView.startCrop(createSaveUri(), mCropCallback, mSaveCallback);
public Uri createSaveUri() {
mCropView.setCompressFormat(Bitmap.CompressFormat.PNG);
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "PNG_" + timeStamp + "_.png";
return getFileProviderUri(new File(getActivity().getCacheDir(), imageFileName));
}
private Uri getFileProviderUri(File photoFile) {
Uri photoURI;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
photoURI = FileProvider.getUriForFile(getActivity(),
"com.strangegt.crop.fileprovider",
photoFile);
} else {
photoURI = Uri.fromFile(new File(photoFile.getAbsolutePath()));
}
return photoURI;
}
This code works on 1.1.4,, i get the grop image in the content uri, and can use it
but in 1.1.7 stop working, the file is saved but this call fail, in saveImage method, and dont get success crop
Utils.updateGalleryInfo(getContext(), uri);
I think fail because i dont save in external storage
I dont save crop image in external storage, i use file provider in chache dir
the code for crop
mCropView.startCrop(createSaveUri(), mCropCallback, mSaveCallback);
This code works on 1.1.4,, i get the grop image in the content uri, and can use it but in 1.1.7 stop working, the file is saved but this call fail, in saveImage method, and dont get success crop
Utils.updateGalleryInfo(getContext(), uri);
I think fail because i dont save in external storage