gpt4 book ai didi

android - Android导航组件Deeplink Backstack

转载 作者:行者123 更新时间:2023-12-02 13:35:53 27 4
gpt4 key购买 nike

我在做navigation component codelab
在10部分中,我们添加了Deeplink小部件。

我将目的地替换为R.id.flow_step_two_dest

  val custAtgs = FlowStepFragmentArgs(2)
val pendingIntent = NavDeepLinkBuilder(context)
.setGraph(R.navigation.mobile_navigation)
.setDestination(R.id.flow_step_two_dest)
.setArguments(custAtgs.toBundle())
.createPendingIntent()

并有这张图

enter image description here

有用。按下后,它会返回首页,但是我希望它会返回到第一步。

这是正确的行为吗?还是我做错了什么?

最佳答案

这是预期的行为。

这是从step 10:

The backstack is generated using the destinations specified with app:startDestination. In this app we only have one activity and one level of navigation, so the backstack will take you to the home_dest destination.



按下“后退”按钮,应该回到 home_dest

More complicated navigation can include nested navigation graphs. The app:startDestination at each level of the nested graphs determines the backstack.



flow_step_one_destflow_step_two_dest包装到一个嵌套图中,并将 flow_step_one_dest设置为开始目标。

按下“后退”按钮将带您回到 flow_step_one_dest,然后回到 home_dest

关于android - Android导航组件Deeplink Backstack,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57308746/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com