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

Fragment createFragment(Bundle args)

Create a new instance of the Fragment associated with this destination.

Class<? extends Fragment> getFragmentClass()

Gets the Fragment associated with this destination

void onInflate(Context context, AttributeSet attrs)

Called when inflating a destination from a resource.

FragmentNavigator.Destination setFragmentClass(Class<? extends Fragment> clazz)

Set the Fragment associated with this destination

Inherited methods

Public constructors

FragmentNavigator.Destination

FragmentNavigator.Destination (NavigatorProvider navigatorProvider)

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

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

FragmentNavigator.Destination

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

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

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

Public methods

createFragment

Fragment createFragment (Bundle args)

Create a new instance of the Fragment associated with this destination.

Parameters
args Bundle: optional args to set on the new Fragment

Returns
Fragment an instance of the Fragment class associated with this destination

getFragmentClass

Class<? extends Fragment> getFragmentClass ()

Gets the Fragment associated with this destination

Returns
Class<? extends Fragment>

onInflate

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

setFragmentClass

FragmentNavigator.Destination setFragmentClass (Class<? extends Fragment> clazz)

Set the Fragment associated with this destination

Parameters
clazz Class: The class name of the Fragment to show when you navigate to this destination

Returns
FragmentNavigator.Destination this FragmentNavigator.Destination