Skip to content

Instantly share code, notes, and snippets.

@shanmugasanthosh7
Created May 26, 2018 16:16
Show Gist options
  • Save shanmugasanthosh7/deaff1b3027196aa1781854a480a1c72 to your computer and use it in GitHub Desktop.
Save shanmugasanthosh7/deaff1b3027196aa1781854a480a1c72 to your computer and use it in GitHub Desktop.
Receives Type Safe arguments
class PassTypeSafeFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_pass_type_safe, container, false)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
val name = PassTypeSafeFragmentArgs.fromBundle(arguments).name
passTypeValue.text = name
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment