From 66b6393b66341b03f77a7a2544e094460ab36eab Mon Sep 17 00:00:00 2001 From: Paul Akhamiogu Date: Sun, 16 Jan 2022 23:47:30 +0000 Subject: [PATCH] fix renamed file leaving trail in media store --- .../kotlin/com/simplemobiletools/commons/extensions/Activity.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt index 49b35144c..ca2840320 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity.kt @@ -841,6 +841,7 @@ fun BaseSimpleActivity.renameFile( runOnUiThread { callback?.invoke(true, false) } + deleteFromMediaStore(oldPath) scanPathRecursively(newPath) } } else { @@ -849,6 +850,7 @@ fun BaseSimpleActivity.renameFile( } updateInMediaStore(oldPath, newPath) scanPathsRecursively(arrayListOf(newPath)) { + deleteFromMediaStore(oldPath) runOnUiThread { callback?.invoke(true, false) }