NavController.OnDestinationChangedListener

interface NavController.OnDestinationChangedListener


OnDestinationChangedListener receives a callback when the currentDestination or its arguments change.

Summary

Public methods

abstract void
onDestinationChanged(
    @NonNull NavController controller,
    @NonNull NavDestination destination,
    @Nullable Bundle arguments
)

Callback for when the currentDestination or its arguments change.

Public methods

onDestinationChanged

@NonNull
public abstract void onDestinationChanged(
    @NonNull NavController controller,
    @NonNull NavDestination destination,
    @Nullable Bundle arguments
)

Callback for when the currentDestination or its arguments change. This navigation may be to a destination that has not been seen before, or one that was previously on the back stack. This method is called after navigation is complete, but associated transitions may still be playing.

Parameters
@NonNull NavController controller

the controller that navigated

@NonNull NavDestination destination

the new destination

@Nullable Bundle arguments

the arguments passed to the destination