diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 5ccc5d1af..2141f70f0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -694,7 +694,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { var resultUri: Uri? = null if (mIsThirdPartyIntent) { when { - intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true -> { + intent.extras?.containsKey(MediaStore.EXTRA_OUTPUT) == true && intent.flags and Intent.FLAG_GRANT_WRITE_URI_PERMISSION != 0 -> { resultUri = fillExtraOutput(resultData) } resultData.extras?.containsKey(PICKED_PATHS) == true -> fillPickedPaths(resultData, resultIntent)