mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 12:38:00 +01:00
properly rename folders
This commit is contained in:
parent
4813a2d5ee
commit
288ba628e6
1 changed files with 5 additions and 10 deletions
|
@ -288,6 +288,11 @@ public class MainActivity extends AppCompatActivity
|
||||||
alertDialog.dismiss();
|
alertDialog.dismiss();
|
||||||
actionMode.finish();
|
actionMode.finish();
|
||||||
|
|
||||||
|
final File[] files = newDir.listFiles();
|
||||||
|
for (File f : files) {
|
||||||
|
updatedFiles.add(f.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
updatedFiles.add(newDir.getAbsolutePath());
|
updatedFiles.add(newDir.getAbsolutePath());
|
||||||
final String[] changedFiles = updatedFiles.toArray(new String[updatedFiles.size()]);
|
final String[] changedFiles = updatedFiles.toArray(new String[updatedFiles.size()]);
|
||||||
MediaScannerConnection.scanFile(getApplicationContext(), changedFiles, null, MainActivity.this);
|
MediaScannerConnection.scanFile(getApplicationContext(), changedFiles, null, MainActivity.this);
|
||||||
|
@ -368,16 +373,6 @@ public class MainActivity extends AppCompatActivity
|
||||||
public void onScanCompleted(final String path, final Uri uri) {
|
public void onScanCompleted(final String path, final Uri uri) {
|
||||||
final File dir = new File(path);
|
final File dir = new File(path);
|
||||||
if (dir.isDirectory()) {
|
if (dir.isDirectory()) {
|
||||||
final List<String> updatedFiles = new ArrayList<>();
|
|
||||||
|
|
||||||
final File[] files = dir.listFiles();
|
|
||||||
for (File f : files) {
|
|
||||||
updatedFiles.add(f.getAbsolutePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
final String[] changedFiles = updatedFiles.toArray(new String[updatedFiles.size()]);
|
|
||||||
MediaScannerConnection.scanFile(getApplicationContext(), changedFiles, null, null);
|
|
||||||
|
|
||||||
dirs = new ArrayList<>(getDirectories().values());
|
dirs = new ArrayList<>(getDirectories().values());
|
||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
Loading…
Reference in a new issue