Wie man mit dem Fragment umgeht
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner){
YOU CODE !!
}
android developer
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner){
YOU CODE !!
}
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) {
findNavController().navigate(R.id.mainFragment)
}
activity?.onBackPressedDispatcher?.addCallback(viewLifecycleOwner, object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
}
})