From d6dd6210c7f150c34bc09647095a898263053adf Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 10 Nov 2016 20:41:13 +0100 Subject: [PATCH] Fixed #50 for reals (treeUri needs to be set at least once, always) --- app/src/main/java/com/simplemobiletools/gallery/Utils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/simplemobiletools/gallery/Utils.kt b/app/src/main/java/com/simplemobiletools/gallery/Utils.kt index f47d84150..ba4fb57d9 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/Utils.kt +++ b/app/src/main/java/com/simplemobiletools/gallery/Utils.kt @@ -171,7 +171,9 @@ class Utils { } fun isShowingWritePermissions(activity: Activity, file: File): Boolean { - return if (needsStupidWritePermissions(activity, file.absolutePath) && !file.canWrite() && Config.newInstance(activity).treeUri.isEmpty()) { + return if ((needsStupidWritePermissions(activity, file.absolutePath) && + !file.canWrite()) || + Config.newInstance(activity).treeUri.isEmpty()) { WritePermissionDialog(activity, object : WritePermissionDialog.OnWritePermissionListener { override fun onConfirmed() { val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE)