ActivityNavigator.Destination
-
android
@NavDestination.ClassType(value = Activity)
open class ActivityNavigator.Destination : NavDestination
NavDestination for activity navigation
Construct a new activity destination. This destination is not valid until you set the Intent via setIntent or one or more of the other set method.
Summary
Public constructors |
|
|---|---|
Destination( |
android
|
Destination(navigatorProvider: NavigatorProvider)Construct a new activity destination. |
android
|
Public functions |
||
|---|---|---|
open operator Boolean |
android
|
|
open Int |
hashCode() |
android
|
open Unit |
@CallSuperCalled when inflating a destination from a resource. |
android
|
ActivityNavigator.Destination |
Sets the action sent when navigating to this destination. |
android
|
ActivityNavigator.Destination |
setComponentName(name: ComponentName?)Set an explicit |
android
|
ActivityNavigator.Destination |
Sets a static data URI that is sent when navigating to this destination. |
android
|
ActivityNavigator.Destination |
setDataPattern(dataPattern: String?)Sets a dynamic data URI pattern that is sent when navigating to this destination. |
android
|
ActivityNavigator.Destination |
Set the Intent to start when navigating to this destination. |
android
|
ActivityNavigator.Destination |
setTargetPackage(packageName: String?)Set an explicit application package name that limits the components this destination will navigate to. |
android
|
open String |
toString() |
android
|
Public properties |
||
|---|---|---|
String? |
The action used to start the Activity, if any |
android
|
ComponentName? |
The explicit |
android
|
Uri? |
The data URI used to start the Activity, if any |
android
|
String? |
The dynamic data URI pattern, if any |
android
|
Intent? |
The Intent associated with this destination. |
android
|
String? |
The explicit application package name associated with this destination, if any |
android
|
Inherited functions |
|||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited properties |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Destination
Destination(
activityNavigator: Navigator<ActivityNavigator.Destination>
)
| Parameters | |
|---|---|
activityNavigator: Navigator<ActivityNavigator.Destination> |
The |
Destination
Destination(navigatorProvider: NavigatorProvider)
Construct a new activity destination. This destination is not valid until you set the Intent via setIntent or one or more of the other set method.
| Parameters | |
|---|---|
navigatorProvider: NavigatorProvider |
The |
Public functions
onInflate
@CallSuper
open fun onInflate(context: Context, attrs: AttributeSet): Unit
Called when inflating a destination from a resource.
| Parameters | |
|---|---|
context: Context |
local context performing inflation |
attrs: AttributeSet |
attrs to parse during inflation |
setAction
fun setAction(action: String?): ActivityNavigator.Destination
Sets the action sent when navigating to this destination.
| Parameters | |
|---|---|
action: String? |
The action string to use. |
| Returns | |
|---|---|
ActivityNavigator.Destination |
this |
setComponentName
fun setComponentName(name: ComponentName?): ActivityNavigator.Destination
Set an explicit ComponentName to navigate to.
| Parameters | |
|---|---|
name: ComponentName? |
The component name of the Activity to start. |
| Returns | |
|---|---|
ActivityNavigator.Destination |
this |
setData
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, which will take precedence when arguments are present.
When inflated from XML, you can use ${applicationId} for string interpolation to automatically use Context.getPackageName.
| Parameters | |
|---|---|
data: Uri? |
A static URI that should always be used. |
| Returns | |
|---|---|
ActivityNavigator.Destination |
this |
| See also | |
|---|---|
setDataPattern |
setDataPattern
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.
When inflated from XML, you can use ${applicationId} as an argument pattern to automatically use Context.getPackageName.
| Parameters | |
|---|---|
dataPattern: String? |
A URI pattern with segments in the form of |
| Returns | |
|---|---|
ActivityNavigator.Destination |
this |
| See also | |
|---|---|
setData |
setIntent
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. |
| Returns | |
|---|---|
ActivityNavigator.Destination |
this |
setTargetPackage
fun setTargetPackage(packageName: String?): ActivityNavigator.Destination
Set an explicit application package name that limits the components this destination will navigate to.
When inflated from XML, you can use ${applicationId} as the package name to automatically use Context.getPackageName.
| Parameters | |
|---|---|
packageName: String? |
packageName to set |
| Returns | |
|---|---|
ActivityNavigator.Destination |
this |
Public properties
component
val component: ComponentName?
The explicit ComponentName associated with this destination, if any
targetPackage
val targetPackage: String?
The explicit application package name associated with this destination, if any