LaunchOptions.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Public Methods
public LaunchOptions.Builder
setAndroidReceiverCompatible
(boolean androidReceiverCompatible)
Sets true
if the sender app supports casting to an Android TV app.
Sets the credentials data.
Sets the desired application locale.
public LaunchOptions.Builder
setRelaunchIfRunning
(boolean relaunchIfRunning)
Sets the "relaunch if running" flag.
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.Builder\u003c/code\u003e helps create \u003ccode\u003eLaunchOptions\u003c/code\u003e objects for configuring how a Cast receiver application is launched.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to set options like relaunch behavior, locale, credentials, and Android TV compatibility.\u003c/p\u003e\n"],["\u003cp\u003eYou can build a \u003ccode\u003eLaunchOptions\u003c/code\u003e instance using the \u003ccode\u003ebuild()\u003c/code\u003e method after configuring the desired options.\u003c/p\u003e\n"],["\u003cp\u003eTwo constructors are available: one to create a new builder and another to create a builder from an existing \u003ccode\u003eLaunchOptions\u003c/code\u003e object.\u003c/p\u003e\n"]]],["The `LaunchOptions.Builder` class facilitates the creation of `LaunchOptions` objects. Builders are constructed with a default or copied `LaunchOptions`. Key actions include setting properties such as `androidReceiverCompatible` to indicate Android TV casting support, `credentialsData`, the desired application `locale`, and `relaunchIfRunning` flag. The builder's `build()` method finalizes and returns the `LaunchOptions` object. It also inherits standard Java object methods like `equals`, `hashCode`, and `toString`.\n"],null,["# LaunchOptions.Builder\n\npublic static final class **LaunchOptions.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA builder for [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions)\nobjects. \n\n### Public Constructor Summary\n\n|---|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#Builder())() Constructs a new [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder). |\n| | [Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#Builder(com.google.android.gms.cast.LaunchOptions))([LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions) copy) Constructs a new [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder) by making a copy of a give [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions). |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions) | [build](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#build())() Builds and returns the [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions) object. |\n| [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder) | [setAndroidReceiverCompatible](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#setAndroidReceiverCompatible(boolean))(boolean androidReceiverCompatible) Sets `true` if the sender app supports casting to an Android TV app. |\n| [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder) | [setCredentialsData](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#setCredentialsData(com.google.android.gms.cast.CredentialsData))([CredentialsData](/android/reference/com/google/android/gms/cast/CredentialsData) credentialsData) Sets the credentials data. |\n| [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder) | [setLocale](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#setLocale(java.util.Locale))([Locale](//developer.android.com/reference/java/util/Locale.html) locale) Sets the desired application locale. |\n| [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder) | [setRelaunchIfRunning](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder#setRelaunchIfRunning(boolean))(boolean relaunchIfRunning) Sets the \"relaunch if running\" flag. |\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\nPublic Constructors\n-------------------\n\n#### public **Builder** ()\n\nConstructs a new [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder). \n\n#### public **Builder** ([LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions) copy)\n\nConstructs a new [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder)\nby making a copy of a give [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions).\n\nPublic Methods\n--------------\n\n#### public [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions)\n**build** ()\n\nBuilds and returns the [LaunchOptions](/android/reference/com/google/android/gms/cast/LaunchOptions)\nobject. \n\n#### public [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder)\n**setAndroidReceiverCompatible** (boolean androidReceiverCompatible)\n\nSets `true` if the sender app supports casting to an Android TV app. \n\n#### public [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder)\n**setCredentialsData** ([CredentialsData](/android/reference/com/google/android/gms/cast/CredentialsData) credentialsData)\n\nSets the credentials data. \n\n#### public [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder)\n**setLocale** ([Locale](//developer.android.com/reference/java/util/Locale.html) locale)\n\nSets the desired application locale. \n\n#### public [LaunchOptions.Builder](/android/reference/com/google/android/gms/cast/LaunchOptions.Builder)\n**setRelaunchIfRunning** (boolean relaunchIfRunning)\n\nSets the \"relaunch if running\" flag."]]