From b21305cb4b6324bdeec4f93e99a24c6af785beb1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 15 May 2019 09:01:39 +0200 Subject: [PATCH] make sure we are updating media from the ui htread --- .../gallery/pro/activities/ViewPagerActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) }