scan only the affected items on Delete
This commit is contained in:
parent
5e845c694c
commit
09e4f00f27
2 changed files with 6 additions and 3 deletions
|
@ -183,7 +183,8 @@ public class PhotosActivity extends AppCompatActivity
|
|||
file.delete();
|
||||
}
|
||||
|
||||
MediaScannerConnection.scanFile(this, new String[]{path}, null, null);
|
||||
final String[] deletedPaths = toBeDeleted.toArray(new String[toBeDeleted.size()]);
|
||||
MediaScannerConnection.scanFile(this, deletedPaths, null, null);
|
||||
}
|
||||
|
||||
private View.OnClickListener undoDeletion = new View.OnClickListener() {
|
||||
|
|
|
@ -102,8 +102,10 @@ public class ViewPagerActivity extends AppCompatActivity
|
|||
private void deleteImage() {
|
||||
Helpers.showToast(this, R.string.deleting);
|
||||
final File file = getCurrentFile();
|
||||
file.delete();
|
||||
MediaScannerConnection.scanFile(this, new String[]{path}, null, this);
|
||||
if (file.delete()) {
|
||||
final String[] deletedPath = new String[]{file.getAbsolutePath()};
|
||||
MediaScannerConnection.scanFile(this, deletedPath, null, this);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDirEmpty() {
|
||||
|
|
Loading…
Reference in a new issue