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 | |
---|---|
Destination(NavigatorProvider navigatorProvider)
Construct a new fragment destination. |
|
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 |
String
|
toString()
|
Inherited methods | |
---|---|
Public constructors
Destination
public 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.
|
Destination
public 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
|
toString
public String toString ()
Returns | |
---|---|
String |