我有一个使用三个LiveData源的MediatorLiveData。当它们中的任何一个发出新值时,并且我至少有一个值,我就使用这三个值为UI生成输出。它看起来像这样: val thingsLiveData: LiveData<List<Thing>> = object: MediatorLiveData<List<Thing>>() {
var
我对MediatorLiveData有个问题。我想在不是ViewModel的类中从数据库中获取数据。BroadcastReceiver() {
lateinit var jobsRepository: jobsRepository
val jobStatusDone: LiveData<Boolean>
private val _counterparti
我在我的ViewModel中使用ViewModel,所以我在片段中观察到的LiveData集合会对code参数的变化做出反应。public class MyViewModel extends AndroidViewModel {
private final MutableLiveData<String> code = new MutableLiveData<>();
// private final MutableLiveD