mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix #50, make sure we have SD write permission before deleting a folder
This commit is contained in:
@ -255,8 +255,10 @@ public class MainActivity extends SimpleActivity
|
||||
|
||||
private void deleteItem(File file) {
|
||||
if (Utils.Companion.needsStupidWritePermissions(this, file.getAbsolutePath())) {
|
||||
final DocumentFile document = Utils.Companion.getFileDocument(this, file.getAbsolutePath());
|
||||
document.delete();
|
||||
if (!Utils.Companion.isShowingWritePermissions(this, new File(file.getAbsolutePath()))) {
|
||||
final DocumentFile document = Utils.Companion.getFileDocument(this, file.getAbsolutePath());
|
||||
document.delete();
|
||||
}
|
||||
} else {
|
||||
file.delete();
|
||||
}
|
||||
|
Reference in New Issue
Block a user