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

NavHostController

open class NavHostController : NavController
kotlin.Any
   ↳ 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.

Summary

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

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

Public methods
Unit

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

Unit

Sets the host's LifecycleOwner.

Unit

Sets the host's OnBackPressedDispatcher.

Unit
setViewModelStore(@NonNull viewModelStore: ViewModelStore)

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

Inherited functions