This course will be retired on July 14, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
When reusing Activities or Views, we need to make sure that users can navigate backwards through our app in an expected manner. Often this means maintaining a custom back stack, where we control what is displayed when they hit the Back button.
Documentation
- Guide: Navigation with Back and Up
- Stack API (Java collection)
- Activity.onBackPressed()
Another Solution
Check out this Community post for an alternative solution for managing the stack found by a Treehouse student.
GitHub Repo
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
pratyush raj
7,097 Points0 Answers
-
Gergő Makkai
825 Points0 Answers
-
Miles Lemon
18,389 Points1 Answer
-
Tomás Borges
4,394 Points0 Answers
-
Evgeniia Vakarina
3,317 Points1 Answer
-
PLUS
Tarek M.Tolba
Courses Plus Student 3,613 Points0 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up