Last active
December 25, 2021 12:20
-
-
Save ErikMedina/d6623364f2fca109ce86bc4f1ed45da5 to your computer and use it in GitHub Desktop.
Custom back 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 onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) { | |
findNavController().navigate(R.id.action_firstFragment_to_homeFragment) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment