[Android] Prevent setting 'loading' value from worker thread

Geoffrey Métais git at videolan.org
Fri Sep 28 15:41:03 CEST 2018


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Sep 28 15:40:10 2018 +0200| [83a7920bf197be6b7e8f6f797aceaffcdc79bd28] | committer: Geoffrey Métais

Prevent setting 'loading' value from worker thread

> https://code.videolan.org/videolan/vlc-android/commit/83a7920bf197be6b7e8f6f797aceaffcdc79bd28
---

 vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
index de51b2f75..bb90cc179 100644
--- a/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
+++ b/vlc-android/src/org/videolan/vlc/viewmodels/paged/MLPagedModel.kt
@@ -71,7 +71,7 @@ abstract class MLPagedModel<T : MediaLibraryItem>(context: Context) : SortableMo
     }
 
     override fun refresh(): Boolean {
-        loading.value = true
+        loading.postValue(true)
         pagedList.value?.dataSource?.invalidate()
         return true
     }



More information about the Android mailing list