Destination

open class Destination : NavDestination
kotlin.Any
   ↳ androidx.navigation.NavDestination
   ↳ androidx.navigation.fragment.FragmentNavigator.Destination

NavDestination specific to FragmentNavigator

Summary

Public constructors

<init>(@NonNull navigatorProvider: NavigatorProvider)

Construct a new fragment destination.

<init>(@NonNull fragmentNavigator: Navigator<out FragmentNavigator.Destination!>)

Construct a new fragment destination.

Public methods

String

Gets the Fragment's class name associated with this destination

open Unit
onInflate(@NonNull context: Context, @NonNull attrs: AttributeSet)

FragmentNavigator.Destination
setClassName(@NonNull className: String)

Set the Fragment class name associated with this destination

Inherited functions

Public constructors

<init>

Destination(@NonNull navigatorProvider: NavigatorProvider)

Construct a new fragment destination. This destination is not valid until you set the Fragment via setClassName(String).

Parameters
navigatorProvider NavigatorProvider: The NavController which this destination will be associated with.

<init>

Destination(@NonNull fragmentNavigator: Navigator<out FragmentNavigator.Destination!>)

Construct a new fragment destination. This destination is not valid until you set the Fragment via setClassName(String).

Parameters
fragmentNavigator Navigator<out FragmentNavigator.Destination!>: The FragmentNavigator which this destination will be associated with. Generally retrieved via a NavController's NavigatorProvider#getNavigator(Class) method.

Public methods

getClassName

@NonNull fun getClassName(): String

Gets the Fragment's class name associated with this destination

Exceptions
IllegalStateException when no Fragment class was set.

onInflate

@CallSuper open fun onInflate(@NonNull context: Context, @NonNull attrs: AttributeSet): Unit

setClassName

@NonNull fun setClassName(@NonNull className: String): FragmentNavigator.Destination

Set the Fragment class name associated with this destination

Parameters
className String: The class name of the Fragment to show when you navigate to this destination
Return
FragmentNavigator.Destination: this Destination