Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

FragmentNavigator.Destination

public static class FragmentNavigator.Destination
extends NavDestination

java.lang.Object
   ↳ androidx.navigation.NavDestination
     ↳ androidx.navigation.fragment.FragmentNavigator.Destination


NavDestination specific to FragmentNavigator

Summary

Public constructors

FragmentNavigator.Destination(NavigatorProvider navigatorProvider)

Construct a new fragment destination.

FragmentNavigator.Destination(Navigator<? extends FragmentNavigator.Destination> fragmentNavigator)

Construct a new fragment destination.

Public methods

final String getClassName()

Gets the Fragment's class name associated with this destination

void onInflate(Context context, AttributeSet attrs)

Called when inflating a destination from a resource.

final FragmentNavigator.Destination setClassName(String className)

Set the Fragment class name associated with this destination

Inherited methods

Public constructors

FragmentNavigator.Destination

public FragmentNavigator.Destination (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.

FragmentNavigator.Destination

public FragmentNavigator.Destination (Navigator<? extends FragmentNavigator.Destination> fragmentNavigator)

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

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

Public methods

getClassName

public final String getClassName ()

Gets the Fragment's class name associated with this destination

Returns
String

Throws
IllegalStateException when no Fragment class was set.

onInflate

public void onInflate (Context context, 
                AttributeSet attrs)

Called when inflating a destination from a resource.

Parameters
context Context: local context performing inflation

attrs AttributeSet: attrs to parse during inflation

setClassName

public final FragmentNavigator.Destination setClassName (String className)

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

Returns
FragmentNavigator.Destination this FragmentNavigator.Destination