Destination

open class Destination
kotlin.Any
   ↳ androidx.navigation.ActivityNavigator.Destination

NavDestination for activity navigation

Summary

Public constructors
<init>(navigatorProvider: NavigatorProvider)

Construct a new activity destination.

<init>(activityNavigator: Navigator<out ActivityNavigator.Destination!>)

Construct a new activity destination.

Public methods
open ActivityNavigator.Destination!
setDataPattern(dataPattern: String!)

Sets a dynamic data URI pattern that is sent when navigating to this destination.

open String!

Gets the dynamic data URI pattern, if any

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

open Intent!

Gets the Intent associated with this destination.

open ComponentName!

Get the explicit ComponentName associated with this destination, if any

open Uri!

Get the data URI used to start the Activity, if any

open ActivityNavigator.Destination!
setData(data: Uri!)

Sets a static data URI that is sent when navigating to this destination.

open ActivityNavigator.Destination!
setIntent(intent: Intent!)

Set the Intent to start when navigating to this destination.

open ActivityNavigator.Destination!
setAction(action: String!)

Sets the action sent when navigating to this destination.

open ActivityNavigator.Destination!

Set an explicit ComponentName to navigate to.

open String!

Get the action used to start the Activity, if any

Public constructors

<init>

Destination(navigatorProvider: NavigatorProvider)

Construct a new activity destination. This destination is not valid until you set the Intent via #setIntent(Intent) or one or more of the other set method.

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

<init>

Destination(activityNavigator: Navigator<out ActivityNavigator.Destination!>)

Construct a new activity destination. This destination is not valid until you set the Intent via #setIntent(Intent) or one or more of the other set method.

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

Public methods

setDataPattern

open fun setDataPattern(dataPattern: String!): ActivityNavigator.Destination!

Sets a dynamic data URI pattern that is sent when navigating to this destination.

If a non-null arguments Bundle is present when navigating, any segments in the form {argName} will be replaced with a URI encoded string from the arguments.

Parameters
dataPattern String!: A URI pattern with segments in the form of {argName} that will be replaced with URI encoded versions of the Strings in the arguments Bundle.
Return
ActivityNavigator.Destination!: this Destination

See Also

getDataPattern

open fun getDataPattern(): String!

Gets the dynamic data URI pattern, if any

onInflate

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

getIntent

open fun getIntent(): Intent!

Gets the Intent associated with this destination.

Return
Intent!:

getComponent

open fun getComponent(): ComponentName!

Get the explicit ComponentName associated with this destination, if any

Return
ComponentName!:

getData

open fun getData(): Uri!

Get the data URI used to start the Activity, if any

setData

open fun setData(data: Uri!): ActivityNavigator.Destination!

Sets a static data URI that is sent when navigating to this destination.

To use a dynamic URI that changes based on the arguments passed in when navigating, use #setDataPattern(String), which will take precedence when arguments are present.

Parameters
data Uri!: A static URI that should always be used.
Return
ActivityNavigator.Destination!: this Destination

setIntent

open fun setIntent(intent: Intent!): ActivityNavigator.Destination!

Set the Intent to start when navigating to this destination.

Parameters
intent Intent!: Intent to associated with this destination.
Return
ActivityNavigator.Destination!: this Destination

setAction

open fun setAction(action: String!): ActivityNavigator.Destination!

Sets the action sent when navigating to this destination.

Parameters
action String!: The action string to use.
Return
ActivityNavigator.Destination!: this Destination

setComponentName

open fun setComponentName(name: ComponentName!): ActivityNavigator.Destination!

Set an explicit ComponentName to navigate to.

Parameters
name ComponentName!: The component name of the Activity to start.
Return
ActivityNavigator.Destination!: this Destination

getAction

open fun getAction(): String!

Get the action used to start the Activity, if any