Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.


open class NavHostController : NavController
   ↳ androidx.navigation.NavController
   ↳ androidx.navigation.NavHostController

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

Apps should generally not construct controllers, instead obtain a relevant controller directly from a navigation host via NavHost#getNavController() or by using one of the utility methods on the Navigation class.


Inherited constants
Public constructors
<init>(@NonNull context: Context)

Construct a new controller for a given Context suitable for use in a NavHost.

Public methods

Set whether the NavController should handle the system Back button events via the registered OnBackPressedDispatcher.


Sets the host's LifecycleOwner.


Sets the host's OnBackPressedDispatcher.

setViewModelStore(@NonNull viewModelStore: ViewModelStore)

Sets the host's ViewModelStore used by the NavController to store ViewModels at the navigation graph level.

Inherited functions