我需要将rate变量从我的存储库传递到视图模型。在视图模型中,我有calculateRate方法,在那里点击按钮后,我得到货币改装问题,然后改装从网络上获得数据。在rate变量中,我有两种货币的交换,我需要将它传递给viewmodel。该怎么做呢?存储库 public class CurrencyRepository {
pri
如何将值从LiveDataReactiveStreams发布到MutableLiveData?我希望实现双向数据绑定,以切换(视图)并将“选中”值从数据库传递到MutableLiveData和UI。//ViewModel
public final MutableLiveData<Boolean> switchChecked = new MutableLiveData<>()