https://kotlinlang.org logo
Title
m

mending3

10/25/2019, 7:17 AM
I've got error:
navigation destination com.example.app.myapp/action_homeFragment_to_mainFragment is unknown to this NavController
mainFragmentViewModel.navigateToHome.observe(this, Observer {
            if (it) {
                this.findNavController().navigate(R.id.action_mainFragment_to_homeFragment)
            } else {
                this.findNavController().navigate(R.id.action_homeFragment_to_mainFragment)
            }
        })
s

Shaheer Muzammil

10/25/2019, 8:07 AM
You cannot access an action defined in HomeFragment tag of your Navigation graph in Main Fragment. You should handle going to MainFragment from HomeFragment in Home Fragment.
m

mending3

10/25/2019, 8:45 AM
okay. get it now