SetValue
-
[Android] AAC-LiveData의 setValue와 postValueAndroid 2021. 4. 23. 10:22
워크 스레드로 카운팅을 하는 앱에서 LiveData를 setValue()로 제대로 갱신되지 않는 상황이 발생했고, postValue()로 변경하면서 해결했다. 그래서 까먹지 않기 위해 setValue와 postValue에 대한 정리를 하려고 한다 :) setValue() 레퍼런스 문서를 보면 setValue는 아래와 같이 정리되어 있다. Sets the value. If there are active observers, the value will be dispatched to them. This method must be called from the main thread. If you need set a value from a background thread, you can use postValue(Ob..