diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt index e469e6571..6cd8e97a4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/ViewPagerActivity.kt @@ -924,7 +924,9 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View private fun handleDeletion(fileDirItem: FileDirItem, deleteFromDatabase: Boolean) { mIgnoredPaths.add(fileDirItem.path) val media = mMediaFiles.filter { !mIgnoredPaths.contains(it.path) } as ArrayList - gotMedia(media) + runOnUiThread { + gotMedia(media) + } tryDeleteFileDirItem(fileDirItem, false, deleteFromDatabase) { mIgnoredPaths.remove(fileDirItem.path) }