From 5e845c694c5e3f901c431607cd9c0d8c74a442bd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 5 Mar 2016 17:39:43 +0100 Subject: [PATCH] refresh only the images which were deleted --- .../gallery/activities/PhotosActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 e04579f95..494ac1ce7 100644 --- a/app/src/main/java/com/simplemobiletools/gallery/activities/PhotosActivity.java +++ b/app/src/main/java/com/simplemobiletools/gallery/activities/PhotosActivity.java @@ -149,12 +149,15 @@ public class PhotosActivity extends AppCompatActivity Helpers.showToast(this, R.string.deleting); final SparseBooleanArray items = gridView.getCheckedItemPositions(); int cnt = items.size(); + final String[] deletedPaths = new String[cnt]; for (int i = 0; i < cnt; i++) { final int id = items.keyAt(i); - toBeDeleted.add(photos.get(id)); + final String path = photos.get(id); + toBeDeleted.add(path); + deletedPaths[i] = path; } - MediaScannerConnection.scanFile(this, new String[]{path}, null, this); + MediaScannerConnection.scanFile(this, deletedPaths, null, this); } private void notifyDeletion(int cnt) {