https://kotlinlang.org logo
Title
k

K Merle

02/16/2022, 6:53 AM
I am getting
java.lang.IllegalStateException: You cannot access the NavBackStackEntry's ViewModels after the NavBackStackEntry is destroyed.
if I switch navigation to fast. Anyone found a solution for it?
This seems to prevent the crash.
c

Colton Idle

02/16/2022, 4:37 PM
I wonder if I should be wrapping all of my calls with this. Hm
i

Ian Lake

02/16/2022, 4:39 PM
We actually just talked about this exception and how it should never, ever happen. Please file a bug if you have a project that reproduces it, even rarely: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1644964904734889?thread_ts=1644600756.208419&cid=CJLTWPH7S
c

Colton Idle

02/16/2022, 4:40 PM
Oh cool. TIL. Maybe I was misremembering from fragment land.
i

Ian Lake

02/16/2022, 4:42 PM
The exception and preventing clicks when your screen is animating out are entirely, completely unrelated to one another
👍 1
Whether you click 1000 times during the animation or not, it should not crash. You probably still don't want the user to click 1000 times though 😄