In same cases Android studio displays warning message when I call
observe method of
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 Int?>): Unit defined in androidx.lifecycle.LiveData
As I understand it’s happened after updating kotlin 1.4 What does it actually mean ?
It means that the extension in androidx is not needed anymore.
Simply remove its import
It will be actually deprecated in androidx. Read more reasoning there.
Please note the “issue” from Erik Hoogendoorn
This change causes values from the observed LiveData object to be interpreted as nullable(since the converted lambda syntax is based on nullable Java code). This was not the case for the Kotlin extension and causes a loss in functionality for the user. In my opinion this change should be reverted and a different solution found.
I’m curious if they will rename & retain the helper or come up with another solution.