Android 12 Developer Preview is here! Try it out, and give us your feedback!

androidx.navigation

Interfaces

FloatingWindow

A marker interface for NavDestination subclasses that float above the view of other destinations (i.e.

NavArgs

An interface marking generated Args classes.

OnDestinationChangedListener

OnDestinationChangedListener receives a callback when the getCurrentDestination() or its arguments change.

NavDirections

An interface that describes a navigation operation: action's id and arguments

NavHost

A host is a single context or container for navigation via a NavController.

Extras

Interface indicating that this class should be passed to its respective Navigator to enable Navigator specific behavior.

Classes

ActionOnlyNavDirections

An implementation of NavDirections without any arguments.

ActivityNavigator

ActivityNavigator implements cross-activity navigation.

ActivityNavigatorDestinationBuilder

DSL for constructing a new ActivityNavigator.Destination

AnimBuilder

DSL for setting custom Animation or Animator resources on a NavOptionsBuilder

NavAction

Navigation actions provide a level of indirection between your navigation code and the underlying destinations.

NavActionBuilder

DSL for building a NavAction.

NavArgsLazy

An implementation of Lazy used by android.app.Activity.navArgs and androidx.fragment.app.Fragment.navArgs.

NavArgument

NavArgument denotes an argument that is supported by a NavDestination.

NavArgumentBuilder

DSL for constructing a new NavArgument

NavBackStackEntry

Representation of an entry in the back stack of a NavController.

NavController

NavController manages app navigation within a NavHost.

NavDeepLink

NavDeepLink encapsulates the parsing and matching of a navigation deep link.

NavDeepLinkBuilder

Class used to construct deep links to a particular destination in a NavGraph.

NavDeepLinkDslBuilder

DSL for constructing a new NavDeepLink

NavDeepLinkRequest

A request for a deep link in a NavDestination.

NavDestination

NavDestination represents one node within an overall navigation graph.

NavDestinationBuilder

DSL for constructing a new NavDestination

NavGraph

NavGraph is a collection of NavDestination nodes fetchable by ID.

NavGraphBuilder

DSL for constructing a new NavGraph

NavGraphNavigator

A Navigator built specifically for NavGraph elements.

NavHostController

Subclass of NavController that offers additional APIs for use by a NavHost to connect the NavController to external dependencies.

Navigation

Entry point for navigation operations.

Navigator

Navigator defines a mechanism for navigating within an app.

NavigatorProvider

A NavigationProvider stores a set of Navigators that are valid ways to navigate to a destination.

NavInflater

Class which translates a navigation XML file into a NavGraph

NavOptions

NavOptions stores special options for navigate actions

NavOptionsBuilder

DSL for constructing a new NavOptions

NavType

NavType denotes the type that can be used in a NavArgument.

PopUpToBuilder

DSL for customizing NavOptionsBuilder.popUpTo operations.

Annotations

NavDeepLinkDsl

NavDestinationDsl

NavOptionsDsl

Top-level functions summary

ActivityNavigator.Extras
ActivityNavigatorExtras(activityOptions: ActivityOptionsCompat? = null, flags: Int = 0)

Create a new ActivityNavigator.Extras instance with a specific ActivityOptionsCompat instance and/or any Intent.FLAG_ACTIVITY_ flags.

NavDeepLink
navDeepLink(deepLinkBuilder: NavDeepLinkDslBuilder.() -> Unit)

Construct a new NavDeepLink

NavOptions
navOptions(optionsBuilder: NavOptionsBuilder.() -> Unit)

Construct a new NavOptions

Extension functions summary

For android.app.Activity
NavController
Activity.findNavController(@IdRes viewId: Int)

Find a NavController given the id of a View and its containing Activity.

NavArgsLazy<Args>

Returns a Lazy delegate to access the Activity's extras as an Args instance.

For android.view.View
NavController

Find a NavController associated with a View.

For NavGraphBuilder
Unit

Construct a new ActivityNavigator.Destination

Unit
NavGraphBuilder.navigation(@IdRes id: Int, @IdRes startDestination: Int, builder: NavGraphBuilder.() -> Unit)

Construct a nested NavGraph

For NavGraph
operator Boolean
NavGraph.contains(@IdRes id: Int)

Returns true if a destination with id is found in this navigation graph.

operator NavDestination