From d52c3df88f2f970793f34bd91f779a6328274290 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 13 May 2018 11:33:51 +0200 Subject: [PATCH] get proper path at returning a third party intent result --- .../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 928457947..67c37b685 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -537,7 +537,8 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } private fun fillIntentPath(resultData: Intent, resultIntent: Intent) { - val path = resultData.data.path + val data = resultData.data + val path = if (data.toString().startsWith("/")) data.toString() else data.path val uri = getFilePublicUri(File(path), BuildConfig.APPLICATION_ID) val type = path.getMimeType() resultIntent.setDataAndTypeAndNormalize(uri, type)