When I put the following code in the Android Studio, Android Studio does not prompt me to import observe
from androidx.lifecycle
. I have to manually do the import and I am starting to get tired of it.
startFragmentViewModel.suggestions.observe(this) {
it?.let { searchView.addSuggestions(it) }
}
Supposing we write a function like so:
//fun Fragment.importObserve() {
// import androidx.lifecycle.observe
//}
Is there a way we can do something like that?