Hyper Nova
01/24/2023, 6:23 PMJaime
01/24/2023, 6:25 PMHyper Nova
01/24/2023, 6:28 PMCasey Brooks
01/24/2023, 6:32 PMJaime
01/24/2023, 6:34 PMHyper Nova
01/24/2023, 6:39 PMJaime
01/24/2023, 6:39 PMHyper Nova
01/24/2023, 6:47 PMIan Lake
01/24/2023, 6:49 PMCasey Brooks
01/24/2023, 6:51 PMJaime
01/24/2023, 6:54 PMHyper Nova
01/24/2023, 7:34 PMjava.lang.IllegalStateException: You cannot access the NavBackStackEntry's ViewModels after the NavBackStackEntry is destroyed.
I have implemented bottom sheet navigation in app and my login screen is not a part of this bottom sheet. So I have a mutable state variable which is set to true when user logs in. I have set an observer on that variable which switches between nav graphs according to its value. Sometimes my app crashes with above error when I logout of the app.Ian Lake
01/24/2023, 7:42 PMHyper Nova
01/24/2023, 8:57 PMIan Lake
01/24/2023, 9:22 PMShakil Karim
01/25/2023, 7:29 AMStylianos Gakis
03/18/2023, 10:19 AMYou can search for “login” in this channel, here’s a few:
None of these really cover the case where an app can not have a fixed start destination, but needs to: • If logged in, show the start destination of being logged in • If logged out, show some screen which lets them login/register etc. I really can say that the vast majority of the apps that I use need this pattern. There’s just no way to have one common screen as a start destination for both logged in and logged out users. And all the proposed solutions make it so that when you go to the login screen you can't really press the back button to get the predictive back animation and exit the app as one would expect. Or maybe it's not what one would expect, really not sure 🤔