Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
146 views
in Technique[技术] by (71.8m points)

Android - Switching from a NavGraph to Another Using Google's Nav Extensions Function

To be able to preserve the backstack and state of the fragments using the Navigation Components and BottomNavigationView, Google has written the NavigationExtensions function.

However, since it's managing the nav graph on its own, does this nullify the navController.graph property? And therefore, can't we switch to the bottomnavigation graphs that we set by using setupWithNavController after having an another nav graph set?

I am trying to navigate from my splash fragment to the BottomNavigationView graphs. But if I set the app:navGraph XML property to my splash graph, both the nav graphs' and splash screen's fragments become visible after the BottomNavigation graphs are set.

Is there a practical solution to achieve this goal?

question from:https://stackoverflow.com/questions/65938561/android-switching-from-a-navgraph-to-another-using-googles-nav-extensions-fun

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...