delete the empty folder itself too

This commit is contained in:
tibbi 2016-03-06 21:51:29 +01:00
parent e03cf07761
commit b880912ecb
3 changed files with 5 additions and 0 deletions

View file

@ -173,10 +173,13 @@ public class MainActivity extends AppCompatActivity
updatedFiles.add(f.getAbsolutePath()); updatedFiles.add(f.getAbsolutePath());
f.delete(); f.delete();
} }
updatedFiles.add(dir.getAbsolutePath());
dir.delete();
} }
final String[] deletedPaths = updatedFiles.toArray(new String[updatedFiles.size()]); final String[] deletedPaths = updatedFiles.toArray(new String[updatedFiles.size()]);
MediaScannerConnection.scanFile(this, deletedPaths, null, null); MediaScannerConnection.scanFile(this, deletedPaths, null, null);
toBeDeleted.clear();
} }
private View.OnClickListener undoDeletion = new View.OnClickListener() { private View.OnClickListener undoDeletion = new View.OnClickListener() {

View file

@ -194,6 +194,7 @@ public class PhotosActivity extends AppCompatActivity
final String[] deletedPaths = toBeDeleted.toArray(new String[toBeDeleted.size()]); final String[] deletedPaths = toBeDeleted.toArray(new String[toBeDeleted.size()]);
MediaScannerConnection.scanFile(this, deletedPaths, null, this); MediaScannerConnection.scanFile(this, deletedPaths, null, this);
toBeDeleted.clear();
} }
private View.OnClickListener undoDeletion = new View.OnClickListener() { private View.OnClickListener undoDeletion = new View.OnClickListener() {

View file

@ -143,6 +143,7 @@ public class ViewPagerActivity extends AppCompatActivity
final String[] deletedPath = new String[]{toBeDeleted}; final String[] deletedPath = new String[]{toBeDeleted};
MediaScannerConnection.scanFile(this, deletedPath, null, this); MediaScannerConnection.scanFile(this, deletedPath, null, this);
} }
toBeDeleted = "";
} }
private View.OnClickListener undoDeletion = new View.OnClickListener() { private View.OnClickListener undoDeletion = new View.OnClickListener() {