NavController
open class NavController
kotlin.Any | |
↳ | androidx.navigation.NavController |
NavController manages app navigation within a NavHost
.
Apps will generally obtain a controller directly from a host, or by using one of the utility methods on the Navigation
class rather than create a controller directly.
Navigation flows and destinations are determined by the navigation graph
owned by the controller. These graphs are typically inflated
from an Android resource, but, like views, they can also be constructed or combined programmatically or for the case of dynamic navigation structure. (For example, if the navigation structure of the application is determined by live data obtained' from a remote server.)
Summary
Nested classes | |
---|---|
abstract |
OnDestinationChangedListener receives a callback when the |
Constants | |
---|---|
static String |
The |
Public constructors | |
---|---|
Constructs a new controller for a given |
Public methods | |
---|---|
open Unit |
Adds an |
open NavDeepLinkBuilder |
Create a deep link to a destination within this NavController. |
open NavBackStackEntry |
getBackStackEntry(@IdRes : Int) Gets the topmost |
open NavBackStackEntry? |
Gets the topmost |
open NavDestination? |
Gets the current destination. |
open NavGraph |
getGraph() Gets the topmost navigation graph associated with this NavController. |
open NavInflater |
Returns the |
open NavigatorProvider |
Retrieve the NavController's |
open NavBackStackEntry? |
Gets the previous visible |
open ViewModelStoreOwner |
getViewModelStoreOwner(@IdRes : Int) Gets the |
open Boolean |
handleDeepLink(@Nullable : Intent?) Checks the given Intent for a Navigation deep link and navigates to the deep link if present. |
open Unit |
Navigate to a destination from the current navigation graph. |
open Unit |
Navigate to a destination from the current navigation graph. |
open Unit |
navigate(@IdRes : Int, @Nullable : Bundle?, @Nullable : NavOptions?) Navigate to a destination from the current navigation graph. |
open Unit |
navigate(@IdRes : Int, @Nullable : Bundle?, @Nullable : NavOptions?, @Nullable : Navigator.Extras?) Navigate to a destination from the current navigation graph. |
open Unit |
Navigate to a destination via the given deep link |
open Unit |
navigate(@NonNull : |