Android Studio
Added in version 37.2

ActivityOptions.LaunchCookie


public static final class ActivityOptions.LaunchCookie
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.ActivityOptions.LaunchCookie


An opaque token used to track and identify a specific activity launch request.

When launching an activity, callers can generate a LaunchCookie and associate it with the launch options using ActivityOptions.setLaunchCookie(LaunchCookie). The system will track the resulting activity and task created by this launch request.

This cookie is particularly useful for tracking launches that undergo redirects or trampolines (where the initial activity immediately starts another activity), as the system automatically transfers the cookie to the final target activity and task.

System components and launchers can use this cookie to identify when a specific launched task has been established, or to guide the placement of the launched task into a specific display or container.

Summary

Inherited constants

Fields

public static final Creator<ActivityOptions.LaunchCookie> CREATOR

Public constructors

LaunchCookie()

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

int hashCode()

Returns a hash code value for the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

Added in version 37.2
public static final Creator<ActivityOptions.LaunchCookie> CREATOR

Public constructors

LaunchCookie

Added in version 37.2
public LaunchCookie ()

Public methods

describeContents

Added in version 37.2
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

equals

Added in version 37.2
public boolean equals (Object obj)

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj Object: This value may be null.
Returns
boolean true if this object is the same as the obj argument; false otherwise.

hashCode

Added in version 37.2
public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

Returns
int a hash code value for this object.

writeToParcel

Added in version 37.2
public void writeToParcel (Parcel dest, 
                int flags)

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.PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following: