NavGraph

public class NavGraph extends NavDestination

Object
   ↳ NavDestination
     ↳ NavGraph

NavGraph is a collection of NavDestination nodes fetchable by ID.

A NavGraph serves as a 'virtual' destination: while the NavGraph itself will not appear on the back stack, navigating to the NavGraph will cause the starting destination to be added to the back stack.

Construct a new NavGraph. This NavGraph is not valid until you add a destination and set the starting destination.

Summary

Nested types

NavGraph.Companion

Public fields

final @NonNull SparseArrayCompat<@NonNull NavDestination>
final @NonNull String
final int

The starting destination id for this NavGraph.

final String

The route for the starting destination for this NavGraph.

Public constructors

NavGraph(Navigator<NavGraph> navGraphNavigator)

Public methods

final void

Add all destinations from another collection to this one.

final void

Adds a destination to this NavGraph.

final void

Adds multiple destinations to this NavGraph.

final void

Adds multiple destinations to this NavGraph.

final void

Clear all destinations from this navigation graph.

boolean