CastState

  • CastState defines the different states a Cast session can be in, such as connected, connecting, not connected, and no devices available.

  • These states are represented by integer constants within the CastState class.

  • The toString() method provides a human-readable representation of a given CastState.

  • The primary use of CastState is to provide information about the current status of Cast interactions.

  • Developers can use the CastState constants to handle different casting scenarios in their applications.

public final class CastState extends Object

The possible casting states.

Constant Summary

int CONNECTED A Cast session is established.
int CONNECTING A Cast session is being established.
int NOT_CONNECTED Cast devices are available, but a Cast session is not established.
int NO_DEVICES_AVAILABLE No Cast devices are available.

Public Method Summary

static String
toString(int castState)

Inherited Method Summary

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)