0

在我更新了我的 build.gradle 文件并设置了

implementation "androidx.appcompat:appcompat:1.2.0" -> implementation "androidx.appcompat:appcompat:1.3.0"

我有一段代码

override var serverIdContactId: MutableLiveData<Pair<Long, Int>> = MutableLiveData(null)
    override val contact: LiveData<Account>
        get() = Transformations.switchMap(serverIdContactId) {
            it?.let {
                accountsRepository.byId(it.first, it.second)
            }
        }

设置 pair 后serverIdContactId,Transformation 永远不会被触发!有什么变化?

4

0 回答 0