-1

On my mobile phone (Android version 5.1.1), when I go into Settings and then pick Apps, I get a list of all the apps installed in my phone. At the same time, the title bar changes from "Settings" to "<- Apps" - that is to say, the title text (which had been at the left edge) slides to the right to make room for a left-pointing arrow that will take me back to the Settings page. This means the "back to the previous page" functionality is now in two places - the left-pointing arrow in the title bar, and the back button that is always there at the bottom of the screen.

This is different from gmail/inbox, where the title bar starts out with the hamburger menu and the title text "Inbox" (or "Primary"), and if I ask to see my Sent items, the hamburger menu remains, the title text changes, and the only way to go back to the original screen is to hit the back button at the bottom of the screen.

And that is different from tripadvisor, which starts out with a graphical title bar, and when you pick a function the title bar changes to text with the left-arrow back button.

And that is different from the Contacts app, where the title bar starts out saying "Contacts", and when you pick a contact the entire screen becomes information on the selected contact (the title bar completely disappears), and the only way to return to the main screen is the back button at the bottom of the screen.

Question 1: Am I correct in assuming that navigation on Android is kind of a "whatever you feel like" kind of situation? Or is there a suggested/preferred way to do navigation, but a lot of app developers ignore it? Or has the suggested/preferred way to do navigation changed through the various Android versions?

Question 2: I'm starting a brand new Android app, doing everything with fragments that I dynamically swap in and out, is there one style of back button that works "best" with the fragment architecture?

Betty Crokker
  • 3,001
  • 6
  • 34
  • 68

1 Answers1

2

What you are discussing is UP navigation versus BACK navigation. They are two separate concepts. From the docs here:

First, UP Navigation:

The Up button is used to navigate within an app based on the hierarchical relationships between screens. For instance, if screen A displays a list of items, and selecting an item leads to screen B (which presents that item in more detail), then screen B should offer an Up button that returns to screen A.

BACK Navigation:

The system Back button is used to navigate, in reverse chronological order, through the history of screens the user has recently worked with. It is generally based on the temporal relationships between screens, rather than the app's hierarchy.

It's important to note that sometimes, these two buttons have the same functionality, which is what leads to confusion with new developers thinking the UP button is just another BACK button. Again, from the docs:

When the previously viewed screen is also the hierarchical parent of the current screen, pressing the Back button has the same result as pressing an Up button—this is a common occurrence. However, unlike the Up button, which ensures the user remains within your app, the Back button can return the user to the Home screen, or even to a different app.

So to answer you question, with UP navigation, yes anything goes to some extent. It depends on how you want the heirarchy of your app set up. But this type of navigation should always keep your user inside your app. But BACK navigation should always return to whatever screen was previously viewed, even if it is the home screen or another app altogether.

You can also see these docs for specific info on how to set up proper UP navigation.

NoChinDeluxe
  • 3,446
  • 1
  • 16
  • 29