---
title: "Comment by Álefe Lucas on \"Building an artificial back stack with the Android Navigation component\" | Hashnode"
description: "Let&#39;s introduce a difficulty: suppose your SecondFragment can also be accessed by another flow unrelated to the HomeFragment. Like this: OutsiderFragment -&"
url: "https://hashnode.com/posts/building-an-artificial-back-stack-with-the-android-navigation-component/61c89dfa1de80a7fb227f39a/comment/6557b2bc39755956a6312cdd"
---

[Discussion](https://hashnode.com/posts/building-an-artificial-back-stack-with-the-android-navigation-component/61c89dfa1de80a7fb227f39a)

Comment [Building an artificial back stack with the Android Navigation component](https://hashnode.com/posts/building-an-artificial-back-stack-with-the-android-navigation-component/61c89dfa1de80a7fb227f39a)

[Álefe Lucas](https://hashnode.com/@alefelucas)

[Nov 17, 2023](https://hashnode.com/posts/building-an-artificial-back-stack-with-the-android-navigation-component/61c89dfa1de80a7fb227f39a/comment/6557b2bc39755956a6312cdd)

Let's introduce a difficulty: suppose your SecondFragment can also be accessed by another flow unrelated to the HomeFragment. Like this: OutsiderFragment -> SecondFragment If you press the back button in the SecondFragment in this stack, you wanna go to the OutsiderFragment, not the HomeFragment. Thus, SecondFragment must NOT assume it always came from the HomeFragment via FirstFragment. An extra point if this behavior can be manager without SecondFragment knowing from where it came from.
