diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameFileDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameFileDialog.kt index 862f7a76d..ea7aef61c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameFileDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameFileDialog.kt @@ -79,7 +79,8 @@ class RenameFileDialog(val activity: SimpleActivity, val file: File, val callbac private fun sendSuccess(oldFile: File, newFile: File) { val values = ContentValues() - values.put(MediaStore.MediaColumns.DATA, newFile.absolutePath) + values.put(MediaStore.MediaColumns.DISPLAY_NAME, newFile.name) + values.put(MediaStore.MediaColumns.TITLE, newFile.name) val uri = if (oldFile.isImageSlow()) MediaStore.Images.Media.EXTERNAL_CONTENT_URI else MediaStore.Video.Media.EXTERNAL_CONTENT_URI val updated = activity.contentResolver.update(uri, values, "${MediaStore.MediaColumns.DATA} = '${oldFile.absolutePath}'", null) == 1