---
title: "Discussion on \"Building an artificial back stack with the Android Navigation component\" | Hashnode"
description: "Discussion on \"Building an artificial back stack with the Android Navigation component\". Context\nBackwards navigation with Navigation Component isn't a mystery, is it? We don't have to do anything, we have it for free.\nBut, what if you want to navigate straight to a specific destination? And be able to navigate back to the start destinat..."
url: "https://hashnode.com/posts/building-an-artificial-back-stack-with-the-android-navigation-component/61c89dfa1de80a7fb227f39a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building an artificial back stack with the Android Navigation component](https://erikmedina.dev/building-an-artificial-back-stack-with-the-android-navigation-component?utm_source=hashnode&utm_medium=feed)

Context Backwards navigation with Navigation Component isn't a mystery, is it? We don't have to do anything, we have it for free. But, what if you want to navigate straight to a specific destination? And be able to navigate back to the start destinat...

Dec 26, 2021 · 5 min read · erikmedina.dev  
Updated Dec 28, 2021  
Read the article

-   [#android](https://hashnode.com/tag/android)
-   [#android-development](https://hashnode.com/tag/android-development)
-   [#software-architecture](https://hashnode.com/tag/software-architecture)
-   [#navigation](https://hashnode.com/tag/navigation)
-   [#android-app-development](https://hashnode.com/tag/android-app-development)

## Written by

[Erik Medina](https://hashnode.com/@erikmedina)

@erikmedina

  
[View profile](https://hashnode.com/@erikmedina)

Software Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Á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.
