Merge pull request #1262 from KryptKode/fix/delete_from_mediastore_on_rename
fix renamed leaves a empty file in media store
This commit is contained in:
commit
9cb42cbf35
1 changed files with 2 additions and 0 deletions
|
@ -841,6 +841,7 @@ fun BaseSimpleActivity.renameFile(
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
callback?.invoke(true, false)
|
callback?.invoke(true, false)
|
||||||
}
|
}
|
||||||
|
deleteFromMediaStore(oldPath)
|
||||||
scanPathRecursively(newPath)
|
scanPathRecursively(newPath)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -849,6 +850,7 @@ fun BaseSimpleActivity.renameFile(
|
||||||
}
|
}
|
||||||
updateInMediaStore(oldPath, newPath)
|
updateInMediaStore(oldPath, newPath)
|
||||||
scanPathsRecursively(arrayListOf(newPath)) {
|
scanPathsRecursively(arrayListOf(newPath)) {
|
||||||
|
deleteFromMediaStore(oldPath)
|
||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
callback?.invoke(true, false)
|
callback?.invoke(true, false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue