Android has two distinct navigation guidelines as opposed to iOS. Getting them right is nuanced.

Apps on iOS usually have a back button. Apps on Android can have a back or an up button. The back button takes you back to where you came from. While the up button takes you one level up.

Confused?

Let me give an example. Consider a simple directory explorer app showing the following folder structure

1
2
3
4
5
Songs
|
|__Pop
|__Rock
|__Rap

Let’s say the user is in the “Rock” folder right now. The up button will always take you back to “Songs”. Now, let’s say there is a way to jump from the “Rock” -> “Pop” folder directly. In that case, the up button will still take you to “Songs” while the back will take you back to “Rock”.

How to implement this?

For back, implement a back stack, for example, the back stack in the above case looks like this.

Songs -> Rock -> Pop

For up, come up with a logical way to show the parent folder, if any. So, the parent folder of “Pop”, “Rock”, and “Rap” will be “Songs”. And since “Songs” is the top-most folder, hide the up navigation in that case.