On which situation android-build/android-studio shows these errors?
Cannot access androidx.lifecycle.LifecycleOwner and
Cannot access androidx.lifecycle.ViewModelStoreOwner
What is the meaning of this errors? I found that adding androidx.lifecycle:lifecycle-viewmodel
as dependency solves these errors, I want to know the meaning of the error in terms of Android Activity LifeCycle(Or is it related to lifecycle or not).
For example in this code call to `super' onSavedInstanceState shows this error
public class AppActivity extends FragmentActivity {
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); // Cannot access androidx.lifecycle.LifecycleOwner
}
}
When should I use Android Lifecycles,and when should I avoid using it?