IllegalArgumentException: navigation destination xxx is unknown to this NavController

后端 未结 30 2327
遇见更好的自我
遇见更好的自我 2020-11-27 11:28

I am having issue with the new Android Navigation Architecture component when I try to navigate from one Fragment to another, I get this weird error:

30条回答
  •  旧巷少年郎
    2020-11-27 12:07

    It could also happen if you have a Fragment A with a ViewPager of Fragments B And you try to navigate from B to C

    Since in the ViewPager the fragments are not a destination of A, your graph wouldn't know you are on B.

    A solution can be to use ADirections in B to navigate to C

提交回复
热议问题