Navigation graphs and multiple host activities

醉酒当歌 提交于 2020-01-25 07:28:08

问题


I have a feature module, splash, which has a nav_splash graph and a SplashActivity.

When I navigate to a second feature module, main, which has a nav_main graph and a MainActivity, instead of using MainActivity as host (even in the navigation editor it is appearing as host), it keeps using SplashActivity as host.

So instead of navigating to nav_main graph, now I have to navigate to an activity (MainActivity) to force the use of this activity as host.

Is this intentionally? Or is it a bug?

The first reason to use multiple activities is that they have different themes in the manifest file.


回答1:


Unless you're specifically navigating to an <activity> destination, you'll stay in the same activity, that is working as intended.



来源:https://stackoverflow.com/questions/57192266/navigation-graphs-and-multiple-host-activities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!