postValue1 Android - Deep dive into LiveData - 2. setValue vs postValue LiveData를 사용할 때, 데이터의 변경은 어떻게 할 수 있을까? 제목에도 나와있듯이, setValue와 postValue가 있다. 왜 두 가지 방법이 있을까? 무슨 차이가 있는지 알아보자. public abstract class LiveData { ... /** * 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 {@link #postValue(Object)} * * @param value .. 2023. 1. 21. 이전 1 다음 반응형