https://kotlinlang.org logo
Title
m

mending3

01/01/2020, 9:24 AM
@SOLVED hey folks i'm on HomeFragment and wanting to navigate to DetailFragment HomeFragment.kt
homeFragmentViewModel.navigateToDetail.observe(this, Observer {
            val action = HomeFragmentDirections.actionHomeFragmentToDetailFragment2()
            action.id = id
            this.findNavController().navigate(action)
            homeFragmentViewModel.navigatedToDetail()
        })
when I click on one of my list, it throws me: n`avigation destination myapp:id/action_homeFragment_to_detailFragment2 is unknown to this NavController` solved by checking the current fragment i'm on first
z

zhuinden

01/03/2020, 10:19 AM
homeFragmentViewModel.navigatedToDetail()
can't wait to forget to call this call and then navigate to that screen each time I go back 🤔