Difference of setValue() & postValue() in MutableLiveData

后端 未结 7 1658
故里飘歌
故里飘歌 2020-11-28 05:34

There are two ways that make change value of MutableLiveData. But what is difference between setValue() & postVa

7条回答
  •  渐次进展
    2020-11-28 06:23

    setValue() method must be called from the main thread. If you need set a value from a background thread, you can use postValue().

    More here .

提交回复
热议问题