mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 14:37:59 +01:00
parent
605a4a29c3
commit
131f0647a9
1 changed files with 15 additions and 0 deletions
|
@ -112,6 +112,8 @@ public class MediaActivity extends SimpleActivity
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rescanDirectory();
|
||||||
|
|
||||||
mMedia = newMedia;
|
mMedia = newMedia;
|
||||||
if (isDirEmpty())
|
if (isDirEmpty())
|
||||||
return;
|
return;
|
||||||
|
@ -144,6 +146,19 @@ public class MediaActivity extends SimpleActivity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void rescanDirectory() {
|
||||||
|
final File file = new File(mPath);
|
||||||
|
if (file.isDirectory()) {
|
||||||
|
final File[] files = file.listFiles();
|
||||||
|
final String[] paths = new String[files.length];
|
||||||
|
final int cnt = file.listFiles().length;
|
||||||
|
for (int i = 0; i < cnt; i++) {
|
||||||
|
paths[i] = files[i].getPath();
|
||||||
|
}
|
||||||
|
MediaScannerConnection.scanFile(getApplicationContext(), paths, null, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void showSortingDialog() {
|
private void showSortingDialog() {
|
||||||
new ChangeSorting(this, false);
|
new ChangeSorting(this, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue