简体   繁体   中英

Navigation Controller: how to insert a fragment in the back stack

I'm programming deep link behavior where a particular link navigates the user to a video. In the normal flow, the user navigates to this video through a course details fragment containing a list of the videos.

However, the deep link flow obviously skips this screen, meaning that when the user backs out of the video, they are sent directly to home. I'd like to insert the course details screen into the backstack so that when the user backs out of the video, they are instead redirected to the course detail screen. What is the best way of doing this?

At the moment, my deep link code executes a navigation to course details screen right before the navigation to the video occurs.

You can make transaction fragments easier by using the following class (which is done with 4 methods in total) For more readability and simplified transaction.

https://github.com/mahditavakoli1312/FragmentTransaction---mahdi-tavakoli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM