Member-only story

Android Navigation With a Pre-Existing Back Stack

Introducing TaskStackBuilder

Stephen Vinouze
Better Programming
4 min readNov 5, 2020

--

Toy figurines walking down the street
Photo by Daniel Cheung on Unsplash.

Navigating remains one of the most challenging topics in mobile applications. While using navigation components or your own navigator, you’ll find many ways to route to a set of screens.

Navigating from A to B to C
Navigating from A to B to C. Photo by the author.

Navigation also implies how to come back to a previous screen. You must ensure that your user can go back somewhere meaningful to your flow.

With the linear routing above, navigating back from C will land you on B. But what if I asked you to navigate to another screen? Since the Android system handles the back stack, this could seem far-fetched, right?

Let’s assume we want to navigate from A to C without coming from B. Yet, we want the user to land on screen B when navigating back from C — no matter if you came from either A or B.

Navigating from A to C with B parenting C
Navigating from A to C with B parenting C

The Deep Link Use Case

For several projects, I’ve been tasked to implement deep links. In mobile applications, the system can…

--

--

Stephen Vinouze
Stephen Vinouze

Written by Stephen Vinouze

✍️ Content creator | 👀 200k Views | 🤖 Keen interest in Android and Jetpack Compose | 🤝 Support me: https://medium.com/@s.vinouze/membership

No responses yet

Write a response