Hey all. I’m using the `LiveData.observe(...)` fun...
# android
o
Hey all. I’m using the
LiveData.observe(...)
function from the
lifecycle-livedata-core-ktx
library. Today I noticed that I’m getting a warning from Android Studio in regards to this function call. Anyone know what this is about?
Copy code
Candidate resolution will be changed soon, please use fully qualified name to invoke the following closer candidate explicitly:
public open fun observe(owner: LifecycleOwner, observer: Observer<in ScreenData!>): Unit defined in androidx.lifecycle.LiveData
i
With Kotlin 1.4, you don't need the extension method at all - Kotlin is smart enough to let you use the lambda syntax already. You can just remove your import of
observe
- we'll be deprecating the extension method once Lifecycle starts to depend on Kotlin 1.4
o
Yes, removing the import did the trick. Thank you @Ian Lake