diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java index 9f5d9c8de..abe67f174 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java @@ -247,15 +247,16 @@ public class MainActivity extends AppCompatActivity return; } + final List updatedFiles = new ArrayList<>(); + updatedFiles.add(dir.getAbsolutePath()); + final File newDir = new File(dir.getParent(), newDirName); if (dir.renameTo(newDir)) { - Utils.showToast(getApplicationContext(), R.string.rename_folder_ok); + Utils.showToast(getApplicationContext(), R.string.renaming_folder); alertDialog.dismiss(); actionMode.finish(); - final List updatedFiles = new ArrayList<>(); - updatedFiles.add(dir.getAbsolutePath()); - updatedFiles.add(newDir.getAbsolutePath()); + updatedFiles.add(newDir.getAbsolutePath()); final String[] changedFiles = updatedFiles.toArray(new String[updatedFiles.size()]); MediaScannerConnection.scanFile(getApplicationContext(), changedFiles, null, MainActivity.this); } else { @@ -348,6 +349,7 @@ public class MainActivity extends AppCompatActivity final String[] changedFiles = updatedFiles.toArray(new String[updatedFiles.size()]); MediaScannerConnection.scanFile(getApplicationContext(), changedFiles, null, null); + Utils.showToast(getApplicationContext(), R.string.rename_folder_ok); dirs = new ArrayList<>(getDirectories().values()); updateGridView(); gridView.requestLayout(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 457e3ea57..088dbd224 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -13,6 +13,7 @@ Could not rename the folder Folder name must not be empty Folder renamed successfully + Renaming folder File name Folder name Extension