Questions tagged «mutablelivedata»

7
MutableLiveData中的setValue()和postValue()的区别
有两种方法可以使的变化值MutableLiveData。但是setValue()&postValue()in 之间有什么区别MutableLiveData。 我找不到相同的文档。 这是MutableLiveDataAndroid 类。 package android.arch.lifecycle; /** * {@link LiveData} which publicly exposes {@link #setValue(T)} and {@link #postValue(T)} method. * * @param <T> The type of data hold by this instance */ @SuppressWarnings("WeakerAccess") public class MutableLiveData<T> extends LiveData<T> { @Override public void postValue(T value) { super.postValue(value); } @Override public …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.