vs as a view for a NavHost

前端 未结 3 1756
[愿得一人]
[愿得一人] 2020-12-01 14:42

When using androidx.fragment.app.FragmentContainerView as a navHost instead of a regular fragment app is not able to navigate to a destination afte

3条回答
  •  情深已故
    2020-12-01 15:21

    The no current navigation node error occurs when there's no graph set and you attempt to call navigate(). If it only occurs when you're using FragmentContainerView and after a configuration change, then this would be related to this bug, which is fixed and scheduled for release with Navigation 2.2.0-rc03.

    To work around this issue, you can either switch back to or remove app:navGraph="@navigation/nav_simple" and instead call navController.setGraph(R.navigation.nav_simple).

提交回复
热议问题