This seeks to resolve two crashes that are difficult to reproduce.
This was introduced in #236:
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(SourceFile:361)
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate.getViewLifecycleOwner
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate.visit
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate.access$visit
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate$attachWebViewAndVisit$1.invoke
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate$attachWebViewAndVisit$1.invoke
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate$attachWebView$2.invoke
at dev.hotwire.turbo.delegates.TurboWebFragmentDelegate$attachWebView$2.invoke
at dev.hotwire.turbo.views.TurboView$attachWebView$1.run
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8663)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
This has existed for a quite awhile:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:6065)
at android.view.ViewGroup.addView(ViewGroup.java:5884)
at android.view.ViewGroup.addView(ViewGroup.java:5824)
at android.view.ViewGroup.addView(ViewGroup.java:5796)
at dev.hotwire.turbo.views.TurboView$attachWebView$1.run
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8538)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
This seeks to resolve two crashes that are difficult to reproduce.
This was introduced in #236:
This has existed for a quite awhile: