Created
January 8, 2022 07:23
-
-
Save Sinarahimi/baf46adb763b1be185c27b05db0b30a8 to your computer and use it in GitHub Desktop.
Pass data to Start Navigation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val extras = intent.extras | |
val finalHost = NavHostFragment.create(R.navigation.main_navigation , bundleOf("Key' to "value")) | |
supportFragmentManager.beginTransaction() | |
.replace(R.id.mainNavHost, finalHost) | |
.setPrimaryNavigationFragment(finalHost) // equivalent to app:defaultNavHost="true" | |
.commit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you wanted to pass args to start Destination in your Navigation Component