我想用
观察实时数据viewlifecycleowner
而不是
this
但是还没有解决。它的依赖是什么?
https://developer.android.com/jetpack/androidx/releases/lifecycle
def lifecycle_version = "2.8.7"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
// Lifecycles only (without ViewModel or LiveData)
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"