【发布时间】:2021-11-27 15:14:56
【问题描述】:
我创建了一个隐式深层链接,就像文档中提到的那样。
https://developer.android.com/guide/navigation/navigation-deep-link#implicit
隐式 - domain.com/ 当我点击它时,你会打开一个新的活动实例,在文档中提到????
如果我按下它会退出应用程序。
文档说它应该回到以前的应用程序并重新加载该片段,我在这里做错了什么?
If the flag is not set, you remain on the task stack of the previous app where the implicit deep link was triggered. In this case, the Back button takes you back to the previous app, while the Up button starts your app's task on the hierarchical parent destination within your navigation graph.
返回按钮和向上按钮有什么区别?
【问题讨论】:
-
你是如何启动你的深层链接的?您的活动是通过
Intent.FLAG_ACTIVITY_NEW_TASK发起的吗?您是使用系统后退按钮还是向上按钮进行测试? -
@ianhanniballake 点击URL后直接启动,activity没有flag。向上按钮将我带到我的应用程序顶部,系统返回关闭应用程序,我已经使用 onbackpress 回调覆盖了 navigateUp() 这不应该执行向上操作吗?
-
“关闭应用程序”是指它会将您返回到您点击 URL 的应用程序?
-
是的,它确实把我带回来了,例如在 discord 上点击它,去那里
标签: android navigation deep-linking android-jetpack android-deep-link