Skip to content

Instantly share code, notes, and snippets.

@codingpizza
Created April 14, 2019 15:19
Show Gist options
  • Save codingpizza/2022ca87afa6bd8b9566670afde66b76 to your computer and use it in GitHub Desktop.
Save codingpizza/2022ca87afa6bd8b9566670afde66b76 to your computer and use it in GitHub Desktop.
Receiving the data from one Fragment using safeArgs
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
arguments?.let{
//Using SafeArgs
val drawableId = DetailFragmentArgs.fromBundle(it).drawableId
ivAnimal?.setImageResource(drawableId)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment