Nested graphs without root destination
See original GitHub issueIs it possible to create a NavGraph without a root destination like below?
NavHost(
navController = navController,
startDestination = "tab_home"
) {
navigation(
route = "tab_home",
startDestination = "start",
) {
composable("start") { /* */ }
composable("next") { /* */ }
}
navigation(
route = "tab_setting",
startDestination = "setting"
) {
composable("setting") { /* */ }
}
}
I added navGraph
option to all @Destination
but the NavGaphs
with Exception was generated.
object NavGraphs {
val tabHome = NavGraph(/* */)
val tabSettings = NavGraph(/* */)
val root: NavGraph = throw RuntimeException("No found destinations for 'root' navigation graph")
}
Is there any solution?
I use version 1.1.5-beta.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Nested navigation graphs - Android Developers
A series of destinations can be grouped into a nested graph within a parent navigation graph called the root graph. Nested graphs are...
Read more >Navigation: Nested graphs and include tag | Android Developers
Nested graphs have their own start destination and don't expose their child destinations separately.
Read more >android - New navigation component from arch with nested ...
Camera is direct destination without any nested graph, Dashboard has it's own nested graph but it's added to same backstack camera fragment ...
Read more >Using nested graph for a bottom bar destination recreates its ...
Let's say you have a bottom bar with three destinations (for instance A, B, C). There are attached to the same nav graph...
Read more >Navigating between modules - MAD Skills - YouTube
In this episode, Murat will demonstrate how you can organize the Navigation graph by using nested graphs and using the include tag to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for dealing with it so quickly. 😃
Thank you for helping.
I tried to create NavGraphs manually, but I didn’t know what to set for root’s
startDestination
.I tried setting
tabHome.startDestination
, but it throwsIllegalArgumentException
.