always try the simple way of deleting files too, like from internal storage

This commit is contained in:
tibbi 2016-11-30 23:22:10 +01:00
parent 5f64a02763
commit 0ab0edd78a
3 changed files with 22 additions and 0 deletions

View file

@ -208,6 +208,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
} else { } else {
file.delete() file.delete()
} }
if (file.exists()) {
try {
file.delete()
} catch (ignored: Exception) {
}
}
} }
private val undoDeletion = View.OnClickListener { private val undoDeletion = View.OnClickListener {

View file

@ -228,6 +228,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
if (file.delete()) if (file.delete())
wereFilesDeleted = true wereFilesDeleted = true
} }
if (file.exists()) {
try {
file.delete()
} catch (ignored: Exception) {
}
}
} }
} }

View file

@ -295,6 +295,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
mWasFileDeleted = file.delete() mWasFileDeleted = file.delete()
} }
if (!mWasFileDeleted) {
try {
mWasFileDeleted = file.delete()
} catch (ignored: Exception) {
}
}
if (mWasFileDeleted) { if (mWasFileDeleted) {
mBeingDeleted = mToBeDeleted mBeingDeleted = mToBeDeleted
scanPath(mToBeDeleted) { scanCompleted() } scanPath(mToBeDeleted) { scanCompleted() }