NavGraphNavigator
public class NavGraphNavigator extends Navigator
DynamicGraphNavigator |
Navigator for graphs in dynamic feature modules. |
A Navigator built specifically for NavGraph elements. Handles navigating to the correct destination when the NavGraph is the target of navigation actions.
Construct a Navigator capable of routing incoming navigation requests to the proper destination within a NavGraph.
Summary
Public fields |
|
|---|---|
final boolean |
Whether this Navigator is actively being used by a |
Public constructors |
|
|---|---|
NavGraphNavigator(@NonNull NavigatorProvider navigatorProvider) |
|
Public methods |
|
|---|---|
@NonNull NavGraph |
Creates a new |
void |
navigate( |
Inherited methods |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
Public fields
isAttached
@NonNull
public final boolean isAttached
Whether this Navigator is actively being used by a NavController.
This is set to true when onAttach is called.
Public constructors
NavGraphNavigator
public final NavGraphNavigator(@NonNull NavigatorProvider navigatorProvider)
| Parameters | |
|---|---|
@NonNull NavigatorProvider navigatorProvider |
NavigatorProvider used to retrieve the correct |
Public methods
createDestination
@NonNull
public NavGraph createDestination()
Creates a new NavGraph associated with this navigator.
navigate
@NonNull
public void navigate(
@NonNull List<@NonNull NavBackStackEntry> entries,
@Nullable NavOptions navOptions,
@Nullable Navigator.Extras navigatorExtras
)
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if given destination is not a child of the current navgraph |