IllegalArgumentException: navigation destination xxx is unknown to this NavController

后端 未结 30 2325
遇见更好的自我
遇见更好的自我 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:12

    In order to avoid this crash one of my colleagues wrote a small library which exposes a SafeNavController, a wrapper around the NavController and handles the cases when this crash occurs because of multiple navigate commands at the same time.

    Here is a short article about the whole issue and the solution.

    You can find the library here.

提交回复
热议问题