diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 3ed48516d..5ef151d91 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -208,6 +208,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { } else { file.delete() } + + if (file.exists()) { + try { + file.delete() + } catch (ignored: Exception) { + } + } } private val undoDeletion = View.OnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 412c05aec..2c6437264 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -228,6 +228,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { if (file.delete()) wereFilesDeleted = true } + + if (file.exists()) { + try { + file.delete() + } catch (ignored: Exception) { + } + } } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt index 0ebe28067..e29352681 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/ViewPagerActivity.kt @@ -295,6 +295,14 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View mWasFileDeleted = file.delete() } + if (!mWasFileDeleted) { + try { + mWasFileDeleted = file.delete() + } catch (ignored: Exception) { + + } + } + if (mWasFileDeleted) { mBeingDeleted = mToBeDeleted scanPath(mToBeDeleted) { scanCompleted() }