LaunchData
Stay organized with collections
Save and categorize content based on your preferences.
This class is deprecated.Starting December 2025, Instant Apps cannot be published through Google Play, and all Google
Play services Instant APIs will no longer work. To continue optimizing for user growth, we
encourage developers to refer users to their regular app or game, and using deeplinks to
redirect them to specific journeys or features when relevant.
Data for launching an instant app.
Meant for use by apps that want to launch instant apps, e.g. web browsers.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
Public Methods
public Bitmap
getApplicationIcon
()
Returns the application icon for the instant app.
Returns
- the application icon for the instant app if one exists for the URL. Otherwise,
null
.
public String
getApplicationLabel
()
Returns the label for the instant app.
Returns
- the label for the instant app if one exists for the URL. Otherwise,
null
.
public Intent
getIntent
()
Returns the Intent
to
launch the instant app.
The caller should add the Intent.EXTRA_REFERRER
extra to the returned instant app Intent, with the Uri
of the referrer
web page, if available, respecting its referrer policy. If the referrer value
originates within or is validated by the caller then Launcher.EXTRA_IS_REFERRER_TRUSTED
extra may be set true.
For clicks within the caller, the Launcher.EXTRA_TRUSTED_REFERRER_PKG
should be set to the package name of the
caller. In other cases, this extra should be set only if the caller can validate the
package name of the originator of the launch.
Extras to be set in the returned intent, as appropriate, by the caller are Intent.EXTRA_REFERRER
, Launcher.EXTRA_TRUSTED_REFERRER_PKG
, Launcher.EXTRA_IS_REFERRER_TRUSTED
, Launcher.EXTRA_IS_USER_CONFIRMED_LAUNCH
, Browser.EXTRA_APPLICATION_ID
, android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES
, android.nfc.NfcAdapter#EXTRA_TAG
, and android.nfc.NfcAdapter#EXTRA_ID
.
Returns
- the
Intent
to
launch the instant app if one exists for the URL. Otherwise, null
.
public String
getPackageName
()
Returns the package name of the instant app.
Returns
- the package name of the instant app if one exists for the URL. Otherwise,
null
.
public void
writeToParcel
( Parcel
dest, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-21 UTC."],[[["\u003cp\u003e\u003ccode\u003eLaunchData\u003c/code\u003e provides necessary information for launching an instant app, like its icon, label, package name, and launch intent.\u003c/p\u003e\n"],["\u003cp\u003ePrimarily used by apps like web browsers intending to launch instant apps.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetIntent()\u003c/code\u003e retrieves the \u003ccode\u003eIntent\u003c/code\u003e to launch the instant app, and callers should add relevant extras like referrer and trusted referrer details.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetApplicationIcon()\u003c/code\u003e, \u003ccode\u003egetApplicationLabel()\u003c/code\u003e, and \u003ccode\u003egetPackageName()\u003c/code\u003e return the instant app's icon, label, and package name, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements \u003ccode\u003eParcelable\u003c/code\u003e for data serialization during transfer between components.\u003c/p\u003e\n"]]],[],null,["# LaunchData\n\npublic class **LaunchData** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \n**This class is deprecated.** \n\nStarting December 2025, Instant Apps cannot be published through Google Play, and all Google\nPlay services Instant APIs will no longer work. To continue optimizing for user growth, we\nencourage developers to refer users to their regular app or game, and using deeplinks to\nredirect them to specific journeys or features when relevant.\n\nData for launching an instant app.\n\nMeant for use by apps that want to launch instant apps, e.g. web browsers. \n\n##### See Also\n\n- [Launcher.getInstantAppLaunchData(String)](/android/reference/com/google/android/gms/instantapps/Launcher#getInstantAppLaunchData(java.lang.String)) \n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Field Summary\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|---|\n| public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[LaunchData](/android/reference/com/google/android/gms/instantapps/LaunchData)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/instantapps/LaunchData#CREATOR) | |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Bitmap](//developer.android.com/reference/android/graphics/Bitmap.html) | [getApplicationIcon](/android/reference/com/google/android/gms/instantapps/LaunchData#getApplicationIcon())() Returns the application icon for the instant app. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getApplicationLabel](/android/reference/com/google/android/gms/instantapps/LaunchData#getApplicationLabel())() Returns the label for the instant app. |\n| [Intent](//developer.android.com/reference/android/content/Intent.html) | [getIntent](/android/reference/com/google/android/gms/instantapps/LaunchData#getIntent())() Returns the [Intent](//developer.android.com/reference/android/content/Intent.html) to launch the instant app. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getPackageName](/android/reference/com/google/android/gms/instantapps/LaunchData#getPackageName())() Returns the package name of the instant app. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/instantapps/LaunchData#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) dest, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[LaunchData](/android/reference/com/google/android/gms/instantapps/LaunchData)\\\u003e\n**CREATOR**\n\nPublic Methods\n--------------\n\n#### public [Bitmap](//developer.android.com/reference/android/graphics/Bitmap.html)\n**getApplicationIcon** ()\n\nReturns the application icon for the instant app. \n\n##### Returns\n\n- the application icon for the instant app if one exists for the URL. Otherwise, `null`. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getApplicationLabel** ()\n\nReturns the label for the instant app. \n\n##### Returns\n\n- the label for the instant app if one exists for the URL. Otherwise, `null`. \n\n#### public [Intent](//developer.android.com/reference/android/content/Intent.html)\n**getIntent** ()\n\nReturns the [Intent](//developer.android.com/reference/android/content/Intent.html) to\nlaunch the instant app.\n\nThe caller should add the [Intent.EXTRA_REFERRER](//developer.android.com/reference/android/content/Intent.html#EXTRA_REFERRER)\nextra to the returned instant app Intent, with the [Uri](//developer.android.com/reference/android/net/Uri.html) of the referrer\nweb page, if available, respecting its referrer policy. If the referrer value\noriginates within or is validated by the caller then [Launcher.EXTRA_IS_REFERRER_TRUSTED](/android/reference/com/google/android/gms/instantapps/Launcher#EXTRA_IS_REFERRER_TRUSTED) extra may be set true.\n\nFor clicks within the caller, the [Launcher.EXTRA_TRUSTED_REFERRER_PKG](/android/reference/com/google/android/gms/instantapps/Launcher#EXTRA_TRUSTED_REFERRER_PKG) should be set to the package name of the\ncaller. In other cases, this extra should be set only if the caller can validate the\npackage name of the originator of the launch.\n\nExtras to be set in the returned intent, as appropriate, by the caller are\n[Intent.EXTRA_REFERRER](//developer.android.com/reference/android/content/Intent.html#EXTRA_REFERRER),\n[Launcher.EXTRA_TRUSTED_REFERRER_PKG](/android/reference/com/google/android/gms/instantapps/Launcher#EXTRA_TRUSTED_REFERRER_PKG), [Launcher.EXTRA_IS_REFERRER_TRUSTED](/android/reference/com/google/android/gms/instantapps/Launcher#EXTRA_IS_REFERRER_TRUSTED), [Launcher.EXTRA_IS_USER_CONFIRMED_LAUNCH](/android/reference/com/google/android/gms/instantapps/Launcher#EXTRA_IS_USER_CONFIRMED_LAUNCH), [Browser.EXTRA_APPLICATION_ID](//developer.android.com/reference/android/provider/Browser.html#EXTRA_APPLICATION_ID),\n`android.nfc.NfcAdapter#EXTRA_NDEF_MESSAGES`,\n`android.nfc.NfcAdapter#EXTRA_TAG`, and\n`android.nfc.NfcAdapter#EXTRA_ID`. \n\n##### Returns\n\n- the [Intent](//developer.android.com/reference/android/content/Intent.html) to launch the instant app if one exists for the URL. Otherwise, `null`. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getPackageName** ()\n\nReturns the package name of the instant app. \n\n##### Returns\n\n- the package name of the instant app if one exists for the URL. Otherwise, `null`. \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) dest, int flags)"]]