# RouteListingPreference.Item

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Item

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/RouteListingPreference.Item "View this page in Java")  

```
class Item : Parcelable
```

|---|----------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                         ||
| ↳ | [android.media.RouteListingPreference.Item](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#) |

Holds preference information for a specific route in a[RouteListingPreference](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference).

## Summary

|                                                                                                        Nested classes                                                                                                        ||
|---|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item.Builder) Builder for[Item](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#). |

|                                                                                                                                                                                                           Constants                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FLAG_ONGOING_SESSION](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION:kotlin.Int) The corresponding route is already hosting a session with the app that owns this listing preference.                                                                                        |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FLAG_ONGOING_SESSION_MANAGED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION_MANAGED:kotlin.Int) Signals that the ongoing session on the corresponding route is managed by the current user of the app.                                                                      |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [FLAG_SUGGESTED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_SUGGESTED:kotlin.Int) The corresponding route is specially likely to be selected by the user.                                                                                                                                 |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SELECTION_BEHAVIOR_GO_TO_APP](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_GO_TO_APP:kotlin.Int) If the user selects the corresponding route, the system takes the user to the application.                                                                                  |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SELECTION_BEHAVIOR_NONE](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_NONE:kotlin.Int) The corresponding route is not selectable by the user.                                                                                                                                |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SELECTION_BEHAVIOR_TRANSFER](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_TRANSFER:kotlin.Int) If the user selects the corresponding route, the media transfers to the said route.                                                                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_AD_ROUTING_DISALLOWED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_AD_ROUTING_DISALLOWED:kotlin.Int) The corresponding route's subtext must indicate that it is not available because an ad is in progress.                                                                    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_CUSTOM](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_CUSTOM:kotlin.Int) The corresponding route's subtext must be obtained from[getCustomSubtextMessage()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getCustomSubtextMessage()). |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_DEVICE_LOW_POWER](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_DEVICE_LOW_POWER:kotlin.Int) The corresponding route's subtext must indicate that it is not available because the device is in low-power mode.                                                                   |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED:kotlin.Int) The corresponding route's subtext must indicate that downloaded content cannot be routed to it.                                           |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_ERROR_UNKNOWN:kotlin.Int) The corresponding route's subtext must indicate that it is not available because of an unknown error.                                                                                     |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_NONE](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_NONE:kotlin.Int) The corresponding route has no associated subtext.                                                                                                                                                          |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_SUBSCRIPTION_REQUIRED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_SUBSCRIPTION_REQUIRED:kotlin.Int) The corresponding route's subtext must indicate that it requires a special subscription in order to be available for routing.                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_TRACK_UNSUPPORTED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_TRACK_UNSUPPORTED:kotlin.Int) The corresponding route's subtext must indicate that it is not available because the device does not support the current media track.                                             |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SUBTEXT_UNAUTHORIZED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_UNAUTHORIZED:kotlin.Int) The corresponding route's subtext must indicate that it is not available because the user is not authorized to route to it.                                                                 |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                   ||
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                     | [describeContents](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#describeContents())`()` <br />                                                                                                                                                                                                                                        |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)             | [equals](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` <br />                                                                                                                                                            |
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | [getCustomSubtextMessage](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getCustomSubtextMessage())`()` Returns a human-readable[CharSequence](https://developer.android.com/reference/kotlin/java/lang/CharSequence.html#)providing the subtext for the corresponding route.                                                           |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                     | [getFlags](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getFlags())`()` Returns the flags associated to the route that corresponds to this item.                                                                                                                                                                                      |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)               | [getRouteId](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getRouteId())`()` Returns the id of the route that corresponds to this route listing preference item.                                                                                                                                                                       |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                     | [getSelectionBehavior](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getSelectionBehavior())`()` Returns the behavior that the corresponding route has if the user selects it.                                                                                                                                                         |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                     | [getSubText](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getSubText())`()` Returns the type of subtext associated to this route.                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                     | [hashCode](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#hashCode())`()` <br />                                                                                                                                                                                                                                                        |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)               | [toString](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#toString())`()` <br />                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                   | [writeToParcel](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Flatten this object in to a Parcel. |

|                                                                                                                                                                                          Properties                                                                                                                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[RouteListingPreference.Item](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#CREATOR:android.os.Parcelable.Creator) <br /> |

## Constants

### FLAG_ONGOING_SESSION

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val FLAG_ONGOING_SESSION: Int
```

The corresponding route is already hosting a session with the app that owns this listing preference.  

    Value: 1

### FLAG_ONGOING_SESSION_MANAGED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val FLAG_ONGOING_SESSION_MANAGED: Int
```

Signals that the ongoing session on the corresponding route is managed by the current user of the app.

The system can use this flag to provide visual indication that the route is not only hosting a session, but also that the user has ownership over said session.

This flag is ignored if[FLAG_ONGOING_SESSION](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION:kotlin.Int)is not set, or if the corresponding route is not currently selected.

This flag does not affect volume adjustment (see[VolumeProvider](https://developer.android.com/reference/kotlin/android/media/VolumeProvider), and[android.media.MediaRoute2Info#getVolumeHandling()](https://developer.android.com/reference/kotlin/android/media/MediaRoute2Info#getVolumeHandling())), or any aspect other than the visual representation of the corresponding item.  

    Value: 2

### FLAG_SUGGESTED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val FLAG_SUGGESTED: Int
```

The corresponding route is specially likely to be selected by the user.

A UI reflecting this preference may reserve a specific space for suggested routes, making it more accessible to the user. If the number of suggested routes exceeds the number supported by the UI, the routes listed first in[android.media.RouteListingPreference#getItems()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference#getItems())will take priority.  

    Value: 4

### SELECTION_BEHAVIOR_GO_TO_APP

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SELECTION_BEHAVIOR_GO_TO_APP: Int
```

If the user selects the corresponding route, the system takes the user to the application.

The system uses[getLinkedItemComponentName()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference#getLinkedItemComponentName())in order to navigate to the app.  

    Value: 2

### SELECTION_BEHAVIOR_NONE

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SELECTION_BEHAVIOR_NONE: Int
```

The corresponding route is not selectable by the user.  

    Value: 0

### SELECTION_BEHAVIOR_TRANSFER

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SELECTION_BEHAVIOR_TRANSFER: Int
```

If the user selects the corresponding route, the media transfers to the said route.  

    Value: 1

### SUBTEXT_AD_ROUTING_DISALLOWED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_AD_ROUTING_DISALLOWED: Int
```

The corresponding route's subtext must indicate that it is not available because an ad is in progress.  

    Value: 4

### SUBTEXT_CUSTOM

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_CUSTOM: Int
```

The corresponding route's subtext must be obtained from[getCustomSubtextMessage()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getCustomSubtextMessage()).

Applications should strongly prefer one of the other disable reasons (for the full list, see[getSubText()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getSubText())) in order to guarantee correct localization and rendering across all form factors.  

    Value: 10000

### SUBTEXT_DEVICE_LOW_POWER

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_DEVICE_LOW_POWER: Int
```

The corresponding route's subtext must indicate that it is not available because the device is in low-power mode.  

    Value: 5

### SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED: Int
```

The corresponding route's subtext must indicate that downloaded content cannot be routed to it.  

    Value: 3

### SUBTEXT_ERROR_UNKNOWN

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_ERROR_UNKNOWN: Int
```

The corresponding route's subtext must indicate that it is not available because of an unknown error.  

    Value: 1

### SUBTEXT_NONE

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_NONE: Int
```

The corresponding route has no associated subtext.  

    Value: 0

### SUBTEXT_SUBSCRIPTION_REQUIRED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_SUBSCRIPTION_REQUIRED: Int
```

The corresponding route's subtext must indicate that it requires a special subscription in order to be available for routing.  

    Value: 2

### SUBTEXT_TRACK_UNSUPPORTED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_TRACK_UNSUPPORTED: Int
```

The corresponding route's subtext must indicate that it is not available because the device does not support the current media track.  

    Value: 7

### SUBTEXT_UNAUTHORIZED

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val SUBTEXT_UNAUTHORIZED: Int
```

The corresponding route's subtext must indicate that it is not available because the user is not authorized to route to it.  

    Value: 6

## Public methods

### describeContents

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | 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](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### equals

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun equals(other: Any?): Boolean
```

|                     Parameters                     ||
|-------|---------------------------------------------|
| `obj` | the reference object with which to compare. |

|                                                                           Return                                                                           ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this object is the same as the obj argument;`false`otherwise. |

### getCustomSubtextMessage

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getCustomSubtextMessage(): CharSequence?
```

Returns a human-readable[CharSequence](https://developer.android.com/reference/kotlin/java/lang/CharSequence.html#)providing the subtext for the corresponding route.

This value is ignored if the[subtext](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getSubText())for this item is not[SUBTEXT_CUSTOM](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_CUSTOM:kotlin.Int)..

Applications must provide a localized message that matches the system's locale. See[Locale.getDefault()](https://developer.android.com/reference/kotlin/java/util/Locale.html#getDefault()).

Applications should avoid using custom messages (and instead use one of non-custom subtexts listed in[getSubText()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getSubText())in order to guarantee correct visual representation and localization on all form factors.

|                                                          Return                                                          ||
|------------------------------------------------------------------------------------------------|--------------------------|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)? | This value may be`null`. |

### getFlags

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getFlags(): Int
```

Returns the flags associated to the route that corresponds to this item.

|                                                                                                                                                                                                                                                                                                                                                  Return                                                                                                                                                                                                                                                                                                                                                   ||
|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is either`0`or a combination of[android.media.RouteListingPreference.Item#FLAG_ONGOING_SESSION](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION:kotlin.Int),[android.media.RouteListingPreference.Item#FLAG_ONGOING_SESSION_MANAGED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION_MANAGED:kotlin.Int), and[android.media.RouteListingPreference.Item#FLAG_SUGGESTED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_SUGGESTED:kotlin.Int) |

**See Also**

- [#FLAG_ONGOING_SESSION](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION:kotlin.Int)
- [#FLAG_ONGOING_SESSION_MANAGED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_ONGOING_SESSION_MANAGED:kotlin.Int)
- [#FLAG_SUGGESTED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#FLAG_SUGGESTED:kotlin.Int)  

### getRouteId

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getRouteId(): String
```

Returns the id of the route that corresponds to this route listing preference item.

|                                                    Return                                                     ||
|----------------------------------------------------------------------------------|-----------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be`null`. |

**See Also**

- [android.media.MediaRoute2Info#getId()](https://developer.android.com/reference/kotlin/android/media/MediaRoute2Info#getId())  

### getSelectionBehavior

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSelectionBehavior(): Int
```

Returns the behavior that the corresponding route has if the user selects it.  
**See Also**

- [#SELECTION_BEHAVIOR_NONE](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_NONE:kotlin.Int)
- [#SELECTION_BEHAVIOR_TRANSFER](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_TRANSFER:kotlin.Int)
- [#SELECTION_BEHAVIOR_GO_TO_APP](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_GO_TO_APP:kotlin.Int)  

### getSubText

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getSubText(): Int
```

Returns the type of subtext associated to this route.

Subtext types other than[SUBTEXT_NONE](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_NONE:kotlin.Int)and[SUBTEXT_CUSTOM](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_CUSTOM:kotlin.Int)must not have[SELECTION_BEHAVIOR_TRANSFER](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SELECTION_BEHAVIOR_TRANSFER:kotlin.Int).

If this method returns[SUBTEXT_CUSTOM](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_CUSTOM:kotlin.Int), then the subtext is obtained form[getCustomSubtextMessage()](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#getCustomSubtextMessage()).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Return                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ||
|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is[android.media.RouteListingPreference.Item#SUBTEXT_NONE](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_NONE:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_ERROR_UNKNOWN:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_SUBSCRIPTION_REQUIRED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_SUBSCRIPTION_REQUIRED:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_AD_ROUTING_DISALLOWED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_AD_ROUTING_DISALLOWED:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_DEVICE_LOW_POWER](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_DEVICE_LOW_POWER:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_UNAUTHORIZED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_UNAUTHORIZED:kotlin.Int),[android.media.RouteListingPreference.Item#SUBTEXT_TRACK_UNSUPPORTED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_TRACK_UNSUPPORTED:kotlin.Int), or[android.media.RouteListingPreference.Item#SUBTEXT_CUSTOM](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_CUSTOM:kotlin.Int) |

**See Also**

- [#SUBTEXT_NONE](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_NONE:kotlin.Int)
- [#SUBTEXT_ERROR_UNKNOWN](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_ERROR_UNKNOWN:kotlin.Int)
- [#SUBTEXT_SUBSCRIPTION_REQUIRED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_SUBSCRIPTION_REQUIRED:kotlin.Int)
- [#SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_DOWNLOADED_CONTENT_ROUTING_DISALLOWED:kotlin.Int)
- [#SUBTEXT_AD_ROUTING_DISALLOWED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_AD_ROUTING_DISALLOWED:kotlin.Int)
- [#SUBTEXT_DEVICE_LOW_POWER](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_DEVICE_LOW_POWER:kotlin.Int)
- [#SUBTEXT_UNAUTHORIZED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_UNAUTHORIZED:kotlin.Int)
- [#SUBTEXT_TRACK_UNSUPPORTED](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_TRACK_UNSUPPORTED:kotlin.Int)
- [#SUBTEXT_CUSTOM](https://developer.android.com/reference/kotlin/android/media/RouteListingPreference.Item#SUBTEXT_CUSTOM:kotlin.Int)  

### hashCode

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun hashCode(): Int
```

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### toString

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

### writeToParcel

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#):This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CREATOR: Parcelable.Creator<RouteListingPreference.Item!>
```