NavInflater

open class NavInflater
kotlin.Any
   ↳ androidx.navigation.NavInflater

Class which translates a navigation XML file into a NavGraph

Summary

Constants
static String

Metadata key for defining an app's default navigation graph.

Public constructors
<init>(c: Context, navigatorProvider: NavigatorProvider)

Public methods
open NavGraph?

Inflates navigation graph as specified in the application manifest.

open NavGraph!
inflate(graphResId: Int)

Inflate a NavGraph from the given XML resource id.

Constants

METADATA_KEY_GRAPH

static val METADATA_KEY_GRAPH: String

Metadata key for defining an app's default navigation graph.

Applications may declare a graph resource in their manifest instead of declaring or passing this data to each host or controller:

  

A graph resource declared in this manner can be inflated into a controller by calling NavController#setMetadataGraph() or directly via #inflateMetadataGraph(). Navigation host implementations should do this automatically if no navigation resource is otherwise supplied during host configuration.

Value: "android.nav.graph"

Public constructors

<init>

NavInflater(c: Context, navigatorProvider: NavigatorProvider)

Public methods

inflateMetadataGraph

open fun inflateMetadataGraph(): NavGraph?

Inflates navigation graph as specified in the application manifest.

Applications may declare a graph resource in their manifest instead of declaring or passing this data to each host or controller:

  

inflate

open fun inflate(graphResId: Int): NavGraph!

Inflate a NavGraph from the given XML resource id.

Parameters
graphResId Int:
Return
NavGraph!: