From 30a0e1ecc956edc81b65d015c973d7f87b489d49 Mon Sep 17 00:00:00 2001 From: Ztiany Date: Mon, 25 Nov 2019 16:51:02 +0800 Subject: [PATCH] fix SystemMediaSelector --- .../com/android/sdk/mediaselector/SystemMediaSelector.java | 2 ++ .../src/main/java/com/android/sdk/mediaselector/Utils.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib_media_selector/src/main/java/com/android/sdk/mediaselector/SystemMediaSelector.java b/lib_media_selector/src/main/java/com/android/sdk/mediaselector/SystemMediaSelector.java index e51c454..19909d9 100644 --- a/lib_media_selector/src/main/java/com/android/sdk/mediaselector/SystemMediaSelector.java +++ b/lib_media_selector/src/main/java/com/android/sdk/mediaselector/SystemMediaSelector.java @@ -238,9 +238,11 @@ public class SystemMediaSelector { private void processUCropResult(Intent data) { Uri uCropResult = Utils.getUCropResult(data); + Log.d(TAG, "processCameraResult() called with: resultCode = [" + "], data = [" + uCropResult + "]"); if (uCropResult == null) { mMediaSelectorCallback.onTakeFail(); } else { + Log.d(TAG, "processCameraResult() called with: resultCode = [" + "], data = [" + Utils.getAbsolutePath(getContext(), uCropResult) + "]"); mMediaSelectorCallback.onTakeSuccess(Utils.getAbsolutePath(getContext(), uCropResult)); } } diff --git a/lib_media_selector/src/main/java/com/android/sdk/mediaselector/Utils.java b/lib_media_selector/src/main/java/com/android/sdk/mediaselector/Utils.java index 8ac67f0..6d878de 100644 --- a/lib_media_selector/src/main/java/com/android/sdk/mediaselector/Utils.java +++ b/lib_media_selector/src/main/java/com/android/sdk/mediaselector/Utils.java @@ -185,6 +185,8 @@ final class Utils { /////////////////////////////////////////////////////////////////////////// static void toUCrop(Context context, Fragment fragment, String srcPath, String targetPath, CropOptions cropConfig, int requestCode) { + makeFilePath(new File(targetPath)); + Uri srcUri = new Uri.Builder() .scheme("file") .appendPath(srcPath) @@ -227,6 +229,7 @@ final class Utils { } Throwable throwable = UCrop.getError(data); if (throwable != null) { + throwable.printStackTrace(); return null; } return UCrop.getOutput(data);