Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道MutableLiveDataextends LiveData,但是它们之间有什么区别(在使用中)。什么是适当的用例,意味着何时使用两者中的正确一个?
MutableLiveData
LiveData
LiveData是不可变的,MutableLiveData而是可变的。MutableLiveData扩展LiveData并提供类似setValue()和的方法postValue()。
setValue()
postValue()