From c7cf5da7c19038c10744cb4c9107e6bc99e2b0ec Mon Sep 17 00:00:00 2001 From: farrokhpey Date: Tue, 9 Oct 2018 12:38:20 +0330 Subject: [PATCH] working for before android M just change 2 line of code to work for android below M --- .../android/library/bottomsheetpicker/FileUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/quanturium/android/library/bottomsheetpicker/FileUtils.java b/library/src/main/java/com/quanturium/android/library/bottomsheetpicker/FileUtils.java index c431978..a93d7da 100644 --- a/library/src/main/java/com/quanturium/android/library/bottomsheetpicker/FileUtils.java +++ b/library/src/main/java/com/quanturium/android/library/bottomsheetpicker/FileUtils.java @@ -26,7 +26,8 @@ public static Uri createImageUri(Context context) throws IOException { } if (file != null) { - result = FileProvider.getUriForFile(context, context.getString(R.string.file_provider_authority), file); + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) result = FileProvider.getUriForFile(context, context.getString(R.string.file_provider_authority), file); + else result = Uri.fromFile(file); } return result; } @@ -41,7 +42,8 @@ public static Uri createVideoUri(Context context) throws IOException { } if (file != null) { - result = FileProvider.getUriForFile(context, context.getString(R.string.file_provider_authority), file); + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) result = FileProvider.getUriForFile(context, context.getString(R.string.file_provider_authority), file); + else result = Uri.fromFile(file); } return result; }