New navigation component from arch with nested navigation graph

后端 未结 7 1197
栀梦
栀梦 2020-12-07 11:26

I have one case and wish to implement it by arch navigation component. For example I have 2 Nav Graphs (main and nested). Can I call main graph from nested and how?

7条回答
  •  醉酒成梦
    2020-12-07 11:59

    Actually is working, using

    val host: NavHostFragment? = (childFragmentManager.findFragmentById(R.id.main_app_fragment_container)  as NavHostFragment?)
    

    I can navigate from main fragment

提交回复
热议问题