From f20ef872cad8c50c8bd7389b844d919c09980260 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 26 May 2019 10:29:57 +0200 Subject: [PATCH] refresh cached directly at contentobserver triggering too --- .../simplemobiletools/gallery/pro/activities/SimpleActivity.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt index 2be7d90fe..684fcd4dc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SimpleActivity.kt @@ -6,11 +6,13 @@ import android.net.Uri import android.provider.MediaStore import android.view.WindowManager import com.simplemobiletools.commons.activities.BaseSimpleActivity +import com.simplemobiletools.commons.extensions.getParentPath import com.simplemobiletools.commons.extensions.getRealPathFromURI import com.simplemobiletools.commons.helpers.isPiePlus import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.extensions.addPathToDB import com.simplemobiletools.gallery.pro.extensions.config +import com.simplemobiletools.gallery.pro.extensions.updateDirectoryPath open class SimpleActivity : BaseSimpleActivity() { val observer = object : ContentObserver(null) { @@ -18,6 +20,7 @@ open class SimpleActivity : BaseSimpleActivity() { super.onChange(selfChange, uri) val path = getRealPathFromURI(uri) if (path != null) { + updateDirectoryPath(path.getParentPath()) addPathToDB(path) } }