IllegalStateException: Link does not have a NavController set

前端 未结 9 2266
故里飘歌
故里飘歌 2020-11-29 03:58

I\'m using Android Navigation Component for Navigation. I have a LoginFragment which has a button to transition to SignUpFragment. On clicking the button I\'m getting this e

9条回答
  •  臣服心动
    2020-11-29 04:22

    In Java try this below line:

    Navigation.findNavController(findViewById(R.id.nav_host_fragment)).navigate(R.id.first_fragment);
    

提交回复
热议问题