ARTICLES

Android Back button does not navigate between bottom navigation bar views

I implemented a bottom navigation bar with multiple fragments.  When selecting each view, I added the fragment to the back stack with transaction.addToBackStack(null).   However, when I pressed the back button the fragments switched but the menu item in the navigation bar would not highlight.

 

Apparently, Material design guidelines state “On Android, the Back button does not navigate between bottom navigation bar views.”

 

As a result I needed to remove the call to addToBackStack as the proper behavior is for the back button to go to the previous app or activity.



Our Products

Kitemetrics
Keyword level attribution for Apple Search Ads. Optimize your bids and increase your revenue. Sign up for free at kitemetrics.com.

White Noise and Deep Sleep Sounds
Calming and relaxing sounds that will help you sleep like a baby tonight.
Download for free from the App Store.
Get it on Google Play.