Skip to content

Instantly share code, notes, and snippets.

@shanmugasanthosh7
Last active August 6, 2018 11:00
Show Gist options
  • Save shanmugasanthosh7/a883e3fdde7b97423d82b6901e4a0f33 to your computer and use it in GitHub Desktop.
Save shanmugasanthosh7/a883e3fdde7b97423d82b6901e4a0f33 to your computer and use it in GitHub Desktop.
class TypeSafeFragment : Fragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_type_safe, container, false)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
passTypeSafe.setOnClickListener {
val action = TypeSafeFragmentDirections.actionTypeSafeFragmentToPassTypeSafeFragment()
action.setName("Santhosh")
Navigation.findNavController(activity!!,R.id.my_nav_host_fragment).navigate(action)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment