refresh only the images which were deleted

This commit is contained in:
tibbi 2016-03-05 17:39:43 +01:00
parent a242fb783d
commit 5e845c694c

View File

@ -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) {