简体   繁体   English

导航组件:如何在使用深度链接导航到目的地后弹出回到之前的目的地?

[英]Navigation Component: How to pop back to previous destination after navigate to a destination using deep link?

I navigate to a destination using deep link in another navigation graph我在另一个导航图中使用深层链接导航到目的地

Navigation.findNavController(view).navigate(Uri.parse(link));

And I just want to return to the previous destination.而我只想回到之前的目的地。

However, popBackStack() only restart the deep link destination但是,popBackStack() 只会重新启动深层链接目标

Navigation.findNavController(view).popBackStack();

How can I return to the previous destination if I insist to use deep link?非要用deep link怎么才能回到之前的目的地呢?

Check this.检查这个。 It might help.它可能会有所帮助。 https://developer.android.com/guide/navigation/navigation-deep-link#explicit https://developer.android.com/guide/navigation/navigation-deep-link#explicit

the start destination of the graph also added to the stack.图的起始目的地也添加到堆栈中。 So when you click on the back button, the start destination on the graph coming to the top of the stack.因此,当您单击后退按钮时,图表上的起始目的地会到达堆栈的顶部。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Android 导航组件中检索目的地的深层链接 - retrieving deep link on destination in Android Navigation Component 如何使用Android导航组件将值传递回之前的片段目的地? - how to pass a value back to previous fragment destination using Android navigation component? 如何使用Android中的导航控制器以编程方式返回上一个目的地? - how to back to previous destination programatically using navigation controller in Android? 当通过导航组件的深层链接打开片段而不是返回到开始目标片段时,在返回按钮上关闭应用程序 - Close app on back button when fragment was opened by deep link of Navigation Component instead of returning to start destination fragment 如何使用导航组件获取上一个目的地? - How to get previous destination with navigation component? 如何使用导航组件导航回上一个片段 - How to navigate back to previous fragment using Navigation component 使用导航组件的多个后退堆栈 - 如何始终 go 开始特定底部导航选项卡的目的地? - Multiple back stacks using navigation component - How to always go to start destination for specific bottom navigation tab? 通过导航架构组件深度链接后的返回导航 - Back navigation after deep link by navigation architecture component 使用 PopUpTo 导航但不知道您的根目的地是什么 - 导航架构组件 - Navigate with PopUpTo but not knowing what you root destination is - Navigation Architecture Component 如何使用 Android 导航组件和深度链接打开活动和特定目的地 - How to open an activity and a particular destination using Android navigation component and deeplink
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM