CastState
Stay organized with collections
Save and categorize content based on your preferences.
The possible casting states.
Inherited Method Summary
From class java.lang.Object
Constants
public static final int
CONNECTED
A Cast session is established.
Constant Value:
4
public static final int
CONNECTING
A Cast session is being established.
Constant Value:
3
public static final int
NOT_CONNECTED
Cast devices are available, but a Cast session is not established.
Constant Value:
2
public static final int
NO_DEVICES_AVAILABLE
No Cast devices are available.
Constant Value:
1
Public Methods
public static String
toString
(int castState)
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\u003eCastState\u003c/code\u003e defines the different states a Cast session can be in, such as connected, connecting, not connected, and no devices available.\u003c/p\u003e\n"],["\u003cp\u003eThese states are represented by integer constants within the \u003ccode\u003eCastState\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etoString()\u003c/code\u003e method provides a human-readable representation of a given \u003ccode\u003eCastState\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe primary use of \u003ccode\u003eCastState\u003c/code\u003e is to provide information about the current status of Cast interactions.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the \u003ccode\u003eCastState\u003c/code\u003e constants to handle different casting scenarios in their applications.\u003c/p\u003e\n"]]],["CastState defines the status of a Cast session, with four possible states: CONNECTED (a session is active), CONNECTING (a session is in progress), NOT_CONNECTED (devices are available but no session exists), and NO_DEVICES_AVAILABLE (no devices are found). The class offers a `toString` method to get a textual description from a given cast state. It also includes the constant value associated to each status.\n"],null,["# CastState\n\npublic final class **CastState** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nThe possible casting states. \n\n### Constant Summary\n\n|-----|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|\n| int | [CONNECTED](/android/reference/com/google/android/gms/cast/framework/CastState#CONNECTED) | A Cast session is established. |\n| int | [CONNECTING](/android/reference/com/google/android/gms/cast/framework/CastState#CONNECTING) | A Cast session is being established. |\n| int | [NOT_CONNECTED](/android/reference/com/google/android/gms/cast/framework/CastState#NOT_CONNECTED) | Cast devices are available, but a Cast session is not established. |\n| int | [NO_DEVICES_AVAILABLE](/android/reference/com/google/android/gms/cast/framework/CastState#NO_DEVICES_AVAILABLE) | No Cast devices are available. |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|\n| static [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/cast/framework/CastState#toString(int))(int castState) |\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\nConstants\n---------\n\n#### public static final int\n**CONNECTED**\n\nA Cast session is established. \nConstant Value: 4 \n\n#### public static final int\n**CONNECTING**\n\nA Cast session is being established. \nConstant Value: 3 \n\n#### public static final int\n**NOT_CONNECTED**\n\nCast devices are available, but a Cast session is not established. \nConstant Value: 2 \n\n#### public static final int\n**NO_DEVICES_AVAILABLE**\n\nNo Cast devices are available. \nConstant Value: 1\n\nPublic Methods\n--------------\n\n#### public static [String](//developer.android.com/reference/java/lang/String.html) **toString** (int castState)"]]