# CastOptions

public class **CastOptions** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
implements [Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) Configuration parameters for initializing the `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastContext`.
The `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions.Builder`
is used to create an instance of `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions`,
and so contains the corresponding setter methods.

### Nested Class Summary

|---|---|---|---|
| class | [CastOptions.Builder](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions.Builder) || A builder to create an instance of `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions` which is used to initialize the `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastContext`. |

### Inherited Constant Summary

From interface android.os.Parcelable

|---|---|---|
| int | CONTENTS_FILE_DESCRIPTOR |   |
| int | PARCELABLE_WRITE_RETURN_VALUE |   |

### Public Method Summary

|---|---|
| [CastMediaOptions](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/media/CastMediaOptions) | [getCastMediaOptions](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getCastMediaOptions())() Returns the `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/media/CastMediaOptions` that is used to configure a media session. |
| boolean | [getEnableReconnectionService](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getEnableReconnectionService())() Returns `true` if `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/ReconnectionService` should be enabled when needed to better handle session recovery. |
| LaunchOptions | [getLaunchOptions](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getLaunchOptions())() Returns the `https://developers.google.com/android/reference/com/google/android/gms/cast/LaunchOptions`. |
| [String](https://developer.android.com/reference/java/lang/String.html) | [getReceiverApplicationId](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getReceiverApplicationId())() Returns the cast receiver application ID. |
| boolean | [getResumeSavedSession](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getResumeSavedSession())() Returns `true` if the saved session should be resumed if it was dropped unexpectedly. |
| boolean | [getShowSystemOutputSwitcherOnCastIconClick](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getShowSystemOutputSwitcherOnCastIconClick())() Returns `true` if the system output switcher should be shown when the cast icon is clicked. |
| boolean | [getStopReceiverApplicationWhenEndingSession](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getStopReceiverApplicationWhenEndingSession())() Returns `true` if the receiver application should be stopped when the session is ended by the user. |
| [List](https://developer.android.com/reference/java/util/List.html)\<[String](https://developer.android.com/reference/java/lang/String.html)\> | [getSupportedNamespaces](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getSupportedNamespaces())() Returns the list of supported cast namespaces. |
| double | [getVolumeDeltaBeforeIceCreamSandwich](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastOptions#getVolumeDeltaBeforeIceCreamSandwich())() *This method is deprecated. Google Play services discontinued updates for Jelly Bean (API levels 16, 17 \& 18) since July 2021. This method will be removed in the next release.* |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface android.os.Parcelable

|---|---|
| abstract int | describeContents() |
| abstract void | writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |

## Public Methods

#### public [CastMediaOptions](https://developers.google.com/android/reference/com/google/android/gms/cast/framework/media/CastMediaOptions)
**getCastMediaOptions** ()

Returns the `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/media/CastMediaOptions`
that is used to configure a media session.

#### public boolean **getEnableReconnectionService** ()

Returns `true` if `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/ReconnectionService`
should be enabled when needed to better handle session recovery.

#### public LaunchOptions **getLaunchOptions** ()

Returns the `https://developers.google.com/android/reference/com/google/android/gms/cast/LaunchOptions`.

#### public [String](https://developer.android.com/reference/java/lang/String.html) **getReceiverApplicationId** ()

Returns the cast receiver application ID. This ID is used in discovering supported
receivers, and launching an application when starting a new session.

#### public boolean **getResumeSavedSession** ()

Returns `true` if the saved session should be resumed if it was dropped
unexpectedly. Returns `false` if the saved session should not be resumed in
this case.

#### public boolean **getShowSystemOutputSwitcherOnCastIconClick** ()

Returns `true` if the system output switcher should be shown when the
cast icon is clicked.

#### public boolean **getStopReceiverApplicationWhenEndingSession** ()

Returns `true` if the receiver application should be stopped when the
session is ended by the user. Returns `false` if the receiver application
should not be stopped in this case.

#### public [List](https://developer.android.com/reference/java/util/List.html)\<[String](https://developer.android.com/reference/java/lang/String.html)\>
**getSupportedNamespaces** ()

Returns the list of supported cast namespaces.

#### public double **getVolumeDeltaBeforeIceCreamSandwich** ()

**This method is deprecated.**   

Google Play services discontinued updates for Jelly Bean (API levels 16, 17 \& 18) since
July 2021. This method will be removed in the next release.
Returns the amount of receiver device volume to increase or decrease when the
physical volume key is pressed on an Android device older than ICE CREAM SANDWICH. The
SDK will call this method to obtain the volume delta when `https://developers.google.com/android/reference/com/google/android/gms/cast/framework/CastContext#onDispatchVolumeKeyEventBeforeJellyBean(android.view.KeyEvent)` is called. The
return value is not used on Android devices running ICE CREAM SANDWICH or newer.