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 ee0e5d473..f2d16ee4a 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/MainActivity.java @@ -173,10 +173,13 @@ public class MainActivity extends AppCompatActivity updatedFiles.add(f.getAbsolutePath()); f.delete(); } + updatedFiles.add(dir.getAbsolutePath()); + dir.delete(); } final String[] deletedPaths = updatedFiles.toArray(new String[updatedFiles.size()]); MediaScannerConnection.scanFile(this, deletedPaths, null, null); + toBeDeleted.clear(); } private View.OnClickListener undoDeletion = new View.OnClickListener() { diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/PhotosActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/PhotosActivity.java index 4b286b971..2a7c9b96a 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/PhotosActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/PhotosActivity.java @@ -194,6 +194,7 @@ public class PhotosActivity extends AppCompatActivity final String[] deletedPaths = toBeDeleted.toArray(new String[toBeDeleted.size()]); MediaScannerConnection.scanFile(this, deletedPaths, null, this); + toBeDeleted.clear(); } private View.OnClickListener undoDeletion = new View.OnClickListener() { diff --git a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java index c1cfd2e85..8b9dd307d 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/ViewPagerActivity.java @@ -143,6 +143,7 @@ public class ViewPagerActivity extends AppCompatActivity final String[] deletedPath = new String[]{toBeDeleted}; MediaScannerConnection.scanFile(this, deletedPath, null, this); } + toBeDeleted = ""; } private View.OnClickListener undoDeletion = new View.OnClickListener() {