Status Update
Comments
jb...@google.com <jb...@google.com>
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #2
Please upgrade to
je...@gmail.com <je...@gmail.com> #4
Yep, you're right. Looks like the root cause of this separate issue was already fixed by 1.3.0
version would pull in the fix.
That fix is part of a 1.2.X
release, unfortunately.
I'll leave this open while we investigate what that would take.
il...@google.com <il...@google.com> #5
My apologies for not trying the latest alpha release beforehand. Upgrading to version 1.3.0
solves my case. Thank you for pointing that out.
lu...@gmail.com <lu...@gmail.com> #6
When using fragment-ktx:1.3.0-alpha03
, I'm still able to reproduce this issue. The following crash occurs on a configuration change:
java.lang.IllegalStateException: Fragment androidx.fragment.app.Fragment$4@5ff632e does not have a view
at androidx.fragment.app.Fragment$4.onFindViewById(Fragment.java:2711)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:464)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1170)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1316)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1394)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1460)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2695)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2644)
at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2784)
at androidx.fragment.app.FragmentStateManager.activityCreated(FragmentStateManager.java:507)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1171)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1316)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1394)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1460)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2695)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2644)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:546)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1392)
at android.app.Activity.performStart(Activity.java:7172)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2967)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6854)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:860)
cl...@google.com <cl...@google.com> #7
Thanks, this looks like an issue with DialogFragment
so fixing that underlying issue should fix PreferenceDialogFragmentCompat
as well.
pr...@google.com <pr...@google.com> #8
Branch: androidx-master-dev
commit 3c698888435fee8af2d911e54d1b9df9fd46648c
Author: Ian Lake <ilake@google.com>
Date: Tue Apr 21 16:46:50 2020
Fix onFindViewById in DialogFragment
Instead of only considering the Fragment's view,
DialogFragment should also consider the Dialog's
view when calling onFindViewById(). This ensures
that any <fragment> or FragmentContainerView that
is created as part of the Dialog's view structure
will properly be reattached to its view hierarchy
after a configuration change.
Test: updated DialogFragmentInflatedChildTest tests pass
BUG: 154366601
Change-Id: I59ada3193974f00ab4df475d992e237baa03c5bf
M fragment/fragment/src/androidTest/java/androidx/fragment/app/DialogFragmentInflatedChildTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/DialogFragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
Description
Component used: Navigation: androidx.navigation:navigation-compose
Version used: 2.8.0-beta02
Per Ian's comment here https://issuetracker.google.com/issues/346505952#comment2 it should not be needed.
Repro here:https://github.com/hrach/navigation-compose/commit/6342c95cc0c57a5e8598f92241d59a658c538071