【发布时间】:2021-09-13 11:26:57
【问题描述】:
导航结构:
MainActivity
|- nav_root
|- HomeFragment
|- AuthNestedGraph
| |- nav_auth
| | |-BeforeOtpFragment(home)
| | |-OtpFragment
|
|- ProfileNestedGraph
| |- nav_prfole
| | |-ProfileFragmentOne(home)
| | |-ProfileFragmentTwo
我可以从 HomeFragment 导航到 BeforeOtp(nav_auth home)、toProfileOne(nav_profile home)。 我也可以从任何身份验证片段导航到 toProfileOne,或从配置文件片段导航到 BeforeOtp 通过全局 id
但是如何从另一个嵌套图形/导航文件的片段导航到未设置主页的子片段?喜欢 OtpFragment/ProfileTwoFragment。如何更改导航控制器?
尝试全局时出现异常:“无法从当前目的地 Destination 中找到”
我可以通过深层链接做到这一点,但这不是我正在寻找的解决方案。
【问题讨论】:
标签: android navigation parent-child android-architecture-navigation android-jetpack-navigation