Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.


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