Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
```
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1029)
at java.util.ArrayList$Itr.next(ArrayList.java:982)
at androidx.fragment.app.FragmentManager.handleOnBackPressed(FragmentManager.java:828)
at androidx.fragment.app.FragmentManager$1.handleOnBackPressed(FragmentManager.java:529)
at androidx.activity.OnBackPressedDispatcher.onBackPressed(OnBackPressedDispatcher.kt:279)
at androidx.activity.OnBackPressedDispatcher$3.invoke(OnBackPressedDispatcher.kt:130)
at androidx.activity.OnBackPressedDispatcher$3.invoke(OnBackPressedDispatcher.kt:127)
at androidx.activity.OnBackPressedDispatcher$Api34Impl$createOnBackAnimationCallback$1.onBackInvoked(OnBackPressedDispatcher.kt:395)
at android.window.WindowOnBackInvokedDispatcher$OnBackInvokedCallbackWrapper.lambda$onBackInvoked$5(WindowOnBackInvokedDispatcher.java:378)
at android.window.WindowOnBackInvokedDispatcher$OnBackInvokedCallbackWrapper.$r8$lambda$Yg9Ce5qkEkMu8Gnl0aIFMDgrwbc(Unknown Source:0)
at android.window.WindowOnBackInvokedDispatcher$OnBackInvokedCallbackWrapper$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at android.os.Handler.handleCallback(Handler.java:959)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
```
Setup:
- Android 34
- opt-in to predictive back using `android:enableOnBackInvokedCallback="true"`
- `androidx.fragment:fragment-ktx:1.7.1` as well as 1.8.0
- `androidx.appcompat:appcompat:1.7.0`, `androidx.lifecycle:lifecycle-*:2.8.2`, `androidx.navigation:navigation-*:2.7.7`
Repro:
- open a fragment
- start navigation back gesture
- while the gesture is in-progress (you can hold it), open a non-cancelable dialog fragment (for example by delaying showing it by half a second after the fragment is created)
- stop the gesture navigation
- dismiss the dialog fragment
- navigate back using gesture
- app crashes
I don't have a sample project and I'm not willing to spend time creating one