update UI at picker dialogs from the main thread

This commit is contained in:
tibbi 2018-04-22 22:08:27 +02:00
parent 37c31f813b
commit b0a26d0bd8
2 changed files with 6 additions and 2 deletions

View file

@ -42,7 +42,9 @@ class PickDirectoryDialog(val activity: BaseSimpleActivity, val sourcePath: Stri
activity.getCachedDirectories { activity.getCachedDirectories {
if (it.isNotEmpty()) { if (it.isNotEmpty()) {
gotDirectories(activity.addTempFolderIfNeeded(it)) activity.runOnUiThread {
gotDirectories(activity.addTempFolderIfNeeded(it))
}
} }
} }

View file

@ -39,7 +39,9 @@ class PickMediumDialog(val activity: BaseSimpleActivity, val path: String, val c
activity.getCachedMedia(path) { activity.getCachedMedia(path) {
val media = it.filter { !it.isVideo() } as ArrayList val media = it.filter { !it.isVideo() } as ArrayList
if (media.isNotEmpty()) { if (media.isNotEmpty()) {
gotMedia(media) activity.runOnUiThread {
gotMedia(media)
}
} }
} }