diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index a802e0da9..0e21e0b2b 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -253,7 +253,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View Thread({ if (needsPermissions) { - val document = getFileDocument(mPath, config.treeUri) + val document = getFileDocument(file.absolutePath, config.treeUri) // double check we have the uri to the proper file path, not some parent folder val uri = URLDecoder.decode(document.uri.toString(), "UTF-8")