mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
fix #50, make sure we have SD write permission before deleting a folder
This commit is contained in:
parent
fa4c6928bd
commit
8108a109dc
1 changed files with 4 additions and 2 deletions
|
@ -255,8 +255,10 @@ public class MainActivity extends SimpleActivity
|
||||||
|
|
||||||
private void deleteItem(File file) {
|
private void deleteItem(File file) {
|
||||||
if (Utils.Companion.needsStupidWritePermissions(this, file.getAbsolutePath())) {
|
if (Utils.Companion.needsStupidWritePermissions(this, file.getAbsolutePath())) {
|
||||||
|
if (!Utils.Companion.isShowingWritePermissions(this, new File(file.getAbsolutePath()))) {
|
||||||
final DocumentFile document = Utils.Companion.getFileDocument(this, file.getAbsolutePath());
|
final DocumentFile document = Utils.Companion.getFileDocument(this, file.getAbsolutePath());
|
||||||
document.delete();
|
document.delete();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue