Skip to content

Common Navigation Paradigms

codepath-wiki-review[bot] edited this page Jun 12, 2026 · 12 revisions

Overview

Navigation between views is an important part of any application. Modern Android apps typically build navigation on top of the Jetpack Navigation component, Google's recommended framework for handling navigation in both Views/Fragments and Jetpack Compose. Navigation centralizes a graph of destinations and exposes a NavController that you wire up to UI patterns such as bottom navigation bars, navigation drawers, and the top app bar.

The most common navigation paradigms in current Android apps are:

  • Bottom Navigation — a BottomNavigationView at the bottom of the screen with 3–5 top-level destinations. It is a concrete subclass of the abstract NavigationBarView base class and is the default Material 3 pattern for top-level destinations on phones.
  • Navigation Drawer — a vertical menu that slides in from the side. Useful when an app has more top-level destinations than fit comfortably in a bottom bar.
  • Swipe Views (Tabs) — paging between sibling screens with ViewPager2, typically combined with TabLayout.
  • Top App Bar — the modern replacement for the ActionBar, used together with Navigation for titles, the Up button, and overflow menus.
  • Screen Map — a list of buttons on a home screen that each launch a destination. Common on early Android, today mostly seen in in-app menus and settings screens.

The remainder of this page links to CodePath cliffnotes and the official guides for each pattern.

Jetpack Navigation Component

The Jetpack Navigation component is Google's recommended way to wire navigation together. It centralizes destinations in a navigation graph and exposes a NavController that you connect to UI components via NavigationUI. Add the appropriate artifact for your UI toolkit:

// Views / Fragments
implementation("androidx.navigation:navigation-fragment:2.9.8")
implementation("androidx.navigation:navigation-ui:2.9.8")

// Jetpack Compose
implementation("androidx.navigation:navigation-compose:2.9.8")

In a Views-based app, call setupWithNavController() on your BottomNavigationView, NavigationView (drawer), or Toolbar so menu item IDs map to destination IDs in the navigation graph. See Connect UI components to NavController for the full setup, and Navigation with Compose for the Compose-specific equivalent.

Navigation in Compose

For apps written in Jetpack Compose, the navigation-compose artifact wires the same NavController and back stack used by the Fragment-based component but presents destinations as composables inside a NavHost. Destinations are typically defined as @Serializable types — type-safe destinations became stable in Navigation 2.8.0 — so navController.navigate(...) accepts typed route objects rather than string templates, and backStackEntry.toRoute<T>() recovers the typed arguments on the destination side.

A newer Compose-first library, Navigation 3 (androidx.navigation3), reached its first stable release on 2025-11-19 (1.0.0) and 1.1.x in mid-2026. It models navigation as a developer-controlled list of NavKey entries displayed by a NavDisplay composable, rather than the route-graph model used by navigation-compose 2.x. Navigation 3 coexists with navigation-compose 2.x rather than replacing it: existing 2.x apps can stay on 2.x, and new Compose-only apps that want a Compose-native state model can adopt Navigation 3 directly. The official guide at Navigation with Compose covers the 2.x flow; the Navigation 3 release notes document the newer library.

Compose can also drive the UI patterns described below: the Material 3 Compose library exposes NavigationBar (bottom bar), NavigationDrawer, and TopAppBar composables that match the widgets described in the Views sections, but configured through composable parameters and a NavController rather than setupWithNavController().

Bottom Navigation

A bottom navigation bar is the most common top-level pattern on phones today. Pair it with the Navigation component by calling setupWithNavController() on the BottomNavigationView so menu item IDs map to destinations. BottomNavigationView is the concrete widget you reference in XML and code; it extends the abstract NavigationBarView base class (shared with NavigationRailView for tablet/foldable layouts), which is where the shared Material 3 navigation APIs live.

See the Bottom Navigation Views cliffnotes for a CodePath walkthrough and the NavigationUI guide for the official integration.

Swiping Views

Check out the ViewPager with FragmentPagerAdapter cliffnotes for the original ViewPager flow. Newer apps should prefer ViewPager2 — combine it with a TabLayout via TabLayoutMediator to show tabs on top of a swiping view. The older PagerSlidingTabStrip approach is documented in the tab indicator cliffnotes.

Navigation Drawer

To create a basic navigation drawer that toggles between displaying different fragments, check out the Fragment Navigation Drawer cliffnotes. For the official setup that wires a NavigationView to a NavController, see the NavigationUI drawer integration docs.

ActionBar Tabs (Legacy)

Check out the ActionBar Tabs cliffnotes for the historical pattern. ActionBar.Tab was deprecated in Android API 21 (Lollipop) in favor of TabLayout on top of ViewPager/ViewPager2; new apps should not use it.

References

Finding these guides helpful?

We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.

Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.

Clone this wiki locally