https://kotlinlang.org logo
Title
d

dimsuz

02/27/2022, 11:17 AM
When using navigation component is it ok to use
navControler.graph.addAll(otherGraph)
/`navController.graph.addDestination()` after navigation has started? For example I want to dynamically decide, based on some user choice, that I want to add a whole bunch of new destinations. Will this work OK (+with composables in the graph)? Or is navigation component designed only so that whole graph must be constructed at once on the start?
a

Adam Powell

02/27/2022, 3:00 PM
If the user returns to the app after the process is restarted for whatever reason, by what mechanism would they return to the navigation destination/back stack state that they were at previously if it included dynamically added destinations?
d

dimsuz

02/27/2022, 4:08 PM
Indeed, nav component doesn't seem to have such mechanism and it would fail. I wonder still will it work prior to restart. Trying to make some decisions upfront, need to take this into account.