Assigned
Status Update
Comments
jo...@element.io <jo...@element.io> #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.
lp...@google.com <lp...@google.com>
jo...@element.io <jo...@element.io> #3
Turns out, we already had a tracking bug for this issue, will follow up on that other one.
Description
Originally reported in b/296891215#5
I'm able to reproduce very similar leak with PopupLayout.
My leak trace is:
We're using compose 1.7.8, kotlin version 1.9.24
Our dropdown usage looks like this:
The issue is also similar to what is reported in b/274016293 (which imo is wrongly marked as a duplicate of b/262356264 , and someone else is able to repro this issue even after b/262356264 was fixed.