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 f734026bc..0c7df443e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -382,7 +382,9 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { mDirs = dirs - setupAdapter() + runOnUiThread { + setupAdapter() + } storeDirectories() } 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 5b5cb89a4..391edfe5d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -449,7 +449,9 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { mLastDrawnHashCode = media.hashCode() mMedia = media - setupAdapter() + runOnUiThread { + setupAdapter() + } storeFolder() }