Closed kralonur closed 3 years ago
The same for me. Please suggest workaround
Fatal Exception: java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner when getView() is null i.e., before onCreateView() or after onDestroyView()
at androidx.fragment.app.Fragment.getViewLifecycleOwner(Fragment.java)
at by.kirich1409.viewbindingdelegate.FragmentViewBindingProperty.getLifecycleOwner(FragmentViewBindingProperty.java)
at by.kirich1409.viewbindingdelegate.FragmentViewBindingProperty.getLifecycleOwner(FragmentViewBindingProperty.java)
at by.kirich1409.viewbindingdelegate.ViewBindingProperty.getValue(ViewBindingProperty.java)
at ua.hope.vkonteksti.lessonview.LessonFragment.getBinding(LessonFragment.java)
at ua.hope.vkonteksti.lessonview.LessonFragment.onLoadFinish(LessonFragment.java)
at ua.hope.vkonteksti.core.view.BaseWebView$2.onPageFinished(BaseWebView.java)
at Ci.b(Ci.java:2)
at kC.handleMessage(kC.java:65)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5421)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
The dialogViewBinding()
delegate works after DialogFragment.onCreateDialog()
call. Before oк inside that callback you will get crash. But I've found issue in the dialogViewBinding()
and it will bi fixed in 1.3.1
I'm using this library with this fragment: https://github.com/kralonur/NotForgot/blob/37ea1a5627fea1d35ac99298786f7ab81f0430e5/app/src/main/java/com/example/notforgot/ui/task_create/category/CategoryDialog.kt
But I'm having crash with this code: (which is exactly code I'm using except using dialogViewBinding)
So basically I'm having crash whereever I use binding.
Logcat: