Assigned
Status Update
Comments
to...@gmail.com <to...@gmail.com> #2
This actually has nothing to do with NavHostFragment, but is the behavior of NavController's setGraph().
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
When you call navController.setGraph(R.navigation.navigation_graph), it stores that ID and will restore that ID automatically.
If you were to instead use:
NavInflater navInflater = new NavInflater(this, navController.getNavigatorProvider());
navController.setGraph(navInflater.inflate(R.navigation.navigation_graph));
Then NavController would not restore the graph itself and the call to restoreState() you point out would only restore the back stack state, etc. but would wait for you to call setGraph again.
You're right that the inconsistency between the two setGraph methods is concerning. We'll take a look.
Description
Jetpack Compose version:Compose 1.8 beta 2
Jetpack Compose component used: Many
Android Studio Build: Android Studio Meerkat Feature Drop | 2024.3.2 Canary 5
Kotlin version: 2.1.10
I do not have yet a repro as I need users to contact me first with details. But I got a lot of crash with marquee on Android 9 only (Many different devices, Samsung, Huawei, LGE,...)
I'm using
basicMarquee(Int.MAX_VALUE)
in a couple of components, but those components can be used in many different ways depending on users settings, so hard to know the exact surrounding layout causing this for now.The marquee code is often used with: