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)