HandoffActivityData


class HandoffActivityData : Parcelable
kotlin.Any
   ↳ android.app.HandoffActivityData

Represents information needed to recreate an activity on a remote device owned by the user.

This class is returned by Activity.onHandoffActivityDataRequested, and is passed to a remote device owned by the user. The remote device will create a launch intent for the activity specified by getComponentName(), passing along any extras specified by getExtras().

If getComponentName() cannot be launched on the remote device, developers can optionally specify a fallback URI in #setFallbackUri(). The URI specified will be launched on the remote device's web browser in this case. If no fallback URI is specified, the user will be presented with an error. If the system is attempting to hand off the entire task, failure to resolve getComponentName() will result in only the top activity of the task being handed off. It is also possible to simply specify a fallback URI, rather than specifying a component name.

Summary

Nested classes

Builder for HandoffActivityData.

Inherited constants
Public methods
static HandoffActivityData

Creates a HandoffActivityData object for a web handoff.

Int

Boolean
equals(other: Any?)

ComponentName?

PersistableBundle

Uri?

Int

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<HandoffActivityData!>

Public methods

createWebHandoff

static fun createWebHandoff(uri: Uri): HandoffActivityData

Creates a HandoffActivityData object for a web handoff.

Parameters
uri Uri: the URI to be launched on the remote device's web browser.
This value cannot be null.
Return
HandoffActivityData the HandoffActivityData object.
This value cannot be null.

describeContents

fun describeContents(): Int

equals

fun equals(other: Any?): Boolean

getComponentName

fun getComponentName(): ComponentName?
Return
ComponentName? the component name of an activity to launch on the remote device when the activity represented by this object is handed off. When this is null, the getFallbackUri() will be used.

getExtras

fun getExtras(): PersistableBundle
Return
PersistableBundle extras to pass inside the launch intent via Intent#putExtras for the activity specified by getComponentName() during handoff. This defaults to an empty bundle.
This value cannot be null.

getFallbackUri

fun getFallbackUri(): Uri?
Return
Uri? the URI which will be launched on the remote device's web browser if the activity specified by getComponentName() cannot be launched, or null if no fallback URI was specified.

hashCode

fun hashCode(): Int

writeToParcel

fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

static val CREATOR: Parcelable.Creator<HandoffActivityData!>