The Android Developer Challenge is back! Submit your idea before December 2.

NavHost

public interface NavHost

androidx.navigation.NavHost


A host is a single context or container for navigation via a NavController.

It is strongly recommended to construct the nav controller by instantiating a NavHostController, which offers additional APIs specifically for a NavHost. The NavHostController should still only be externally accessible as a NavController, rather than directly exposing it as a NavHostController.

Navigation hosts must:

Optionally, a navigation host should consider calling:

Summary

Public methods

abstract NavController getNavController()

Returns the navigation controller for this navigation host.

Public methods

getNavController

public abstract NavController getNavController ()

Returns the navigation controller for this navigation host.

Returns
NavController this host's navigation controller