From eac2a37bad213bcd3cb5e7779cead504a1148d45 Mon Sep 17 00:00:00 2001 From: Tibor Kaputa Date: Mon, 6 Mar 2017 11:52:41 +0100 Subject: [PATCH] one more uri change --- .../com/simplemobiletools/gallery/activities/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 4a24dedd1..36a517b7a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -4,10 +4,10 @@ import android.Manifest import android.app.Activity import android.content.Intent import android.content.pm.PackageManager -import android.net.Uri import android.os.Bundle import android.provider.MediaStore import android.support.v4.app.ActivityCompat +import android.support.v4.content.FileProvider import android.support.v7.widget.GridLayoutManager import android.view.Menu import android.view.MenuItem @@ -286,7 +286,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { if (requestCode == PICK_MEDIA && resultData != null) { Intent().apply { val path = resultData.data.path - val uri = Uri.fromFile(File(path)) + val uri = FileProvider.getUriForFile(this@MainActivity, "$packageName.provider", File(path)) if (mIsGetImageContentIntent || mIsGetVideoContentIntent || mIsGetAnyContentIntent) { val type = File(path).getMimeType("image/jpeg") setDataAndTypeAndNormalize(uri, type)