Added in API level 34

RouteListingPreference


class RouteListingPreference : Parcelable
kotlin.Any
   ↳ android.media.RouteListingPreference

Allows applications to customize the list of routes used for media routing (for example, in the System UI Output Switcher).

Summary

Nested classes

Builder for RouteListingPreference.

Holds preference information for a specific route in a RouteListingPreference.

Constants
static String

Intent action that the system uses to take the user the app when the user selects an Item whose selection behavior is android.media.RouteListingPreference.Item#SELECTION_BEHAVIOR_GO_TO_APP.

static String

Intent string extra key that contains the id of the route to transfer to, as part of an ACTION_TRANSFER_MEDIA intent.

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

MutableList<RouteListingPreference.Item!>

Returns an unmodifiable list containing the items that the app wants to be listed for media routing.

ComponentName?

Returns a ComponentName for navigating to the application.

Boolean

Returns true if the application would like media route listing to use the system's ordering strategy, or false if the application would like route listing to respect the ordering obtained from getItems().

Int

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<RouteListingPreference!>

Constants

ACTION_TRANSFER_MEDIA

Added in API level 34
static val ACTION_TRANSFER_MEDIA: String

Intent action that the system uses to take the user the app when the user selects an Item whose selection behavior is android.media.RouteListingPreference.Item#SELECTION_BEHAVIOR_GO_TO_APP.

The launched intent will identify the selected item using the extra identified by EXTRA_ROUTE_ID.

Value: "android.media.action.TRANSFER_MEDIA"

EXTRA_ROUTE_ID

Added in API level 34
static val EXTRA_ROUTE_ID: String

Intent string extra key that contains the id of the route to transfer to, as part of an ACTION_TRANSFER_MEDIA intent.

Value: "android.media.extra.ROUTE_ID"

Public methods

describeContents

Added in API level 34
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 34
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getItems

Added in API level 34
fun getItems(): MutableList<RouteListingPreference.Item!>

Returns an unmodifiable list containing the items that the app wants to be listed for media routing.

Return
MutableList<RouteListingPreference.Item!> This value cannot be null.

getLinkedItemComponentName

Added in API level 34
fun getLinkedItemComponentName(): ComponentName?

Returns a ComponentName for navigating to the application.

Must not be null if any of the items of this route listing preference has selection behavior android.media.RouteListingPreference.Item#SELECTION_BEHAVIOR_GO_TO_APP.

The system navigates to the application when the user selects Item with android.media.RouteListingPreference.Item#SELECTION_BEHAVIOR_GO_TO_APP by launching an intent to the returned ComponentName, using action ACTION_TRANSFER_MEDIA, with the extra EXTRA_ROUTE_ID.

getUseSystemOrdering

Added in API level 34
fun getUseSystemOrdering(): Boolean

Returns true if the application would like media route listing to use the system's ordering strategy, or false if the application would like route listing to respect the ordering obtained from getItems().

The system's ordering strategy is implementation-dependent, but may take into account each route's recency or frequency of use in order to rank them.

hashCode

Added in API level 34
fun hashCode(): Int
Return
Int a hash code value for this object.

writeToParcel

Added in API level 34
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 34
static val CREATOR: Parcelable.Creator<RouteListingPreference!>