From 092ea401b3f5eef6d512ab9d4f27cf0df2f097b5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Mar 2017 12:09:04 +0100 Subject: [PATCH] fix the pick_media intent sent from third party apps --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index c404d1b78..791d59878 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -5,6 +5,7 @@ import android.app.Activity import android.content.Intent import android.content.pm.PackageManager import android.content.res.Configuration +import android.net.Uri import android.os.Bundle import android.provider.MediaStore import android.support.v4.app.ActivityCompat @@ -274,7 +275,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { if (requestCode == PICK_MEDIA && resultData != null) { Intent().apply { val path = resultData.data.path - val uri = getFileUri(File(path)) + val uri = Uri.fromFile(File(path)) if (mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent) { val type = File(path).getMimeType("image/jpeg") setDataAndTypeAndNormalize(uri, type)