Skip to content

Instantly share code, notes, and snippets.

@Sinarahimi
Created January 8, 2022 07:28
Show Gist options
  • Save Sinarahimi/9de51199aa0a0ec4852fecf6c6ac764c to your computer and use it in GitHub Desktop.
Save Sinarahimi/9de51199aa0a0ec4852fecf6c6ac764c to your computer and use it in GitHub Desktop.
Pass data to Start Navigation
//MainFragment is an start Destination in navigation
class MainFragment:Fragmnet{
// Dont use private val args: MainFragmentArgs by navArgs() to get the args if you wanted to pass data to startDestination
//Fragmnet
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
arguments?.get("Key")
}
}
@Sinarahimi
Copy link
Author

watch this gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment