LaunchOptions
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Constructor Summary
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 boolean
equals
( Object
obj)
public boolean
getAndroidReceiverCompatible
()
Returns true
if the sender app supports casting to an Android TV
app.
public String
getLanguage
()
Returns the language, or null
if none was specified.
public boolean
getRelaunchIfRunning
()
Returns the "relaunch if running" flag.
public int
hashCode
()
Overridden to return a hashcode of the device ID.
public void
setLanguage
( String
language)
Sets the language to be used by the receiver application. If not specified, the
sender device's default language is used.
public void
setRelaunchIfRunning
(boolean
relaunchIfRunning)
Sets the "relaunch if running" flag. If the flag is set, the receiver application
will be relaunched even if it is already running. The flag is not set by default.
public String
toString
()
Returns a string representation of this object.
public void
writeToParcel
( Parcel
out, 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 2024-10-31 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 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eLaunchOptions\u003c/code\u003e is an object that holds options affecting how a receiver application is launched for the Google Cast SDK.\u003c/p\u003e\n"],["\u003cp\u003eIt allows developers to specify parameters like language, relaunch behavior, and compatibility with Android TV receivers.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLaunchOptions\u003c/code\u003e can be built using a \u003ccode\u003eLaunchOptions.Builder\u003c/code\u003e and includes methods for setting and retrieving launch preferences.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements \u003ccode\u003eParcelable\u003c/code\u003e, enabling it to be passed between components and processes within the Android framework.\u003c/p\u003e\n"]]],["`LaunchOptions` is an object that configures how a receiver application is launched. Key actions include setting the language via `setLanguage`, which defaults to the sender device's language if not specified. The `setRelaunchIfRunning` method determines if an already running receiver should be restarted. It also supports checking if the sender can cast to an Android TV app using `getAndroidReceiverCompatible` and retrieving credentials via `getCredentialsData`. Other functions check the hash code and convert the object to string.\n"],null,["# LaunchOptions\n\npublic class **LaunchOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nAn object that holds options that affect how a receiver application is launched. See\n[Cast.CastApi.launchApplication(GoogleApiClient, String, LaunchOptions)](/android/reference/com/google/android/gms/cast/Cast.CastApi#launchApplication(com.google.android.gms.common.api.GoogleApiClient,%20java.lang.String,%20com.google.android.gms.cast.LaunchOptions)). \n\n### Nested Class Summary\n\n|-------|---|---|------------------------------------------------------------------------------------------------------|\n| class | [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder) || A builder for [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions) objects. |\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### Public Constructor Summary\n\n|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions#LaunchOptions())() The constructor of [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions). |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/cast/LaunchOptions#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) obj) |\n| boolean | [getAndroidReceiverCompatible](/android/reference/com/google/android/gms/cast/LaunchOptions#getAndroidReceiverCompatible())() Returns `true` if the sender app supports casting to an Android TV app. |\n| [CredentialsData](/android/reference/com/google/android/gms/cast/CredentialsData) | [getCredentialsData](/android/reference/com/google/android/gms/cast/LaunchOptions#getCredentialsData())() Returns the [CredentialsData](/android/reference/com/google/android/gms/cast/CredentialsData). |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getLanguage](/android/reference/com/google/android/gms/cast/LaunchOptions#getLanguage())() Returns the language, or `null` if none was specified. |\n| boolean | [getRelaunchIfRunning](/android/reference/com/google/android/gms/cast/LaunchOptions#getRelaunchIfRunning())() Returns the \"relaunch if running\" flag. |\n| int | [hashCode](/android/reference/com/google/android/gms/cast/LaunchOptions#hashCode())() Overridden to return a hashcode of the device ID. |\n| void | [setLanguage](/android/reference/com/google/android/gms/cast/LaunchOptions#setLanguage(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) language) Sets the language to be used by the receiver application. |\n| void | [setRelaunchIfRunning](/android/reference/com/google/android/gms/cast/LaunchOptions#setRelaunchIfRunning(boolean))(boolean relaunchIfRunning) Sets the \"relaunch if running\" flag. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/cast/LaunchOptions#toString())() Returns a string representation of this object. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/cast/LaunchOptions#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, 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\nPublic Constructors\n-------------------\n\n#### public **LaunchOptions** ()\n\nThe constructor of [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions).\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) obj)\n\n#### public boolean **getAndroidReceiverCompatible** ()\n\nReturns `true` if the sender app supports casting to an Android TV\napp. \n\n#### public [CredentialsData](/android/reference/com/google/android/gms/cast/CredentialsData)\n**getCredentialsData** ()\n\nReturns the [CredentialsData](/android/reference/com/google/android/gms/cast/CredentialsData). \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getLanguage** ()\n\nReturns the language, or `null` if none was specified. \n\n#### public boolean **getRelaunchIfRunning** ()\n\nReturns the \"relaunch if running\" flag. \n\n#### public int **hashCode** ()\n\nOverridden to return a hashcode of the device ID. \n\n#### public void **setLanguage** ([String](//developer.android.com/reference/java/lang/String.html) language)\n\nSets the language to be used by the receiver application. If not specified, the\nsender device's default language is used. \n\n##### Parameters\n\n| language | The language |\n|----------|--------------|\n\n#### public void **setRelaunchIfRunning** (boolean relaunchIfRunning)\n\nSets the \"relaunch if running\" flag. If the flag is set, the receiver application\nwill be relaunched even if it is already running. The flag is not set by default. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\nReturns a string representation of this object. \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]