Answers for "onbackpressed in fragment what happens"

3

how to handle onbackpressed in fragment

requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner){
	YOU CODE !!
}
Posted by: Guest on November-09-2021
2

onbackpressed android fragment

requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) {
            findNavController().navigate(R.id.mainFragment)
        }
Posted by: Guest on February-27-2021

Code answers related to "onbackpressed in fragment what happens"

Browse Popular Code Answers by Language