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

# RouteGroup

*** ** * ** ***

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

```
open class RouteGroup : MediaRouter.RouteInfo
```

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

Information about a route that consists of multiple other routes in a group.

## Summary

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#DEVICE_TYPE_BLUETOOTH:kotlin.Int` A receiver device type of the route indicating the presentation of the media is happening on a bluetooth device such as a bluetooth speaker. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#DEVICE_TYPE_SPEAKER:kotlin.Int` A receiver device type of the route indicating the presentation of the media is happening on a speaker. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#DEVICE_TYPE_TV:kotlin.Int` A receiver device type of the route indicating the presentation of the media is happening on a TV. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#DEVICE_TYPE_UNKNOWN:kotlin.Int` The default receiver device type of the route indicating the type is unknown. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#PLAYBACK_TYPE_LOCAL:kotlin.Int` The default playback type, "local", indicating the presentation of the media is happening on the same device (e.g. a phone, a tablet) as where it is controlled from. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#PLAYBACK_TYPE_REMOTE:kotlin.Int` A playback type indicating the presentation of the media is happening on a different device (i.e. the remote device) than where it is controlled from. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#PLAYBACK_VOLUME_FIXED:kotlin.Int` Playback information indicating the playback volume is fixed, i.e. it cannot be controlled from this object. An example of fixed playback volume is a remote player, playing over HDMI where the user prefers to control the volume on the HDMI sink, rather than attenuate at the source. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#PLAYBACK_VOLUME_VARIABLE:kotlin.Int` Playback information indicating the playback volume is variable and can be controlled from this object. <br /> | ||

| Public methods ||
|---|---|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#addRoute(android.media.MediaRouter.RouteInfo)(route: https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo!)` Add a route to this group. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#addRoute(android.media.MediaRouter.RouteInfo,%20kotlin.Int)(route: https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo!, insertAt: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Add a route to this group before the specified index. |
| open [MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)! | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#getRouteAt(kotlin.Int)(index: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Return the route in this group at the specified index |
| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#getRouteCount()()` <br /> |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#removeRoute(android.media.MediaRouter.RouteInfo)(route: https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo!)` Remove a route from this group. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#removeRoute(kotlin.Int)(index: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Remove the route at the specified index from this group. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#requestSetVolume(kotlin.Int)(volume: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Request a volume change for this route. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#requestUpdateVolume(kotlin.Int)(direction: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Request an incremental volume update for this route. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#setIconDrawable(android.graphics.drawable.Drawable)(icon: https://developer.android.com/reference/kotlin/android/graphics/drawable/Drawable.html#!)` Set an icon that will be used to represent this group. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#setIconResource(kotlin.Int)(resId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Set an icon that will be used to represent this group. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#toString()()` Returns a string representation of the object. |

| Inherited functions ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo` |---|---| | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getCategory()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getDescription()()` Gets the user-visible description of the route. The route description describes the kind of destination represented by the route. It may be a user-supplied string, a model number or brand of device. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getDeviceType()()` Gets the type of the receiver device associated with this route. <br /> | | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup#!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getGroup()()` <br /> | | `https://developer.android.com/reference/kotlin/android/graphics/drawable/Drawable.html#!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getIconDrawable()()` Get the icon representing this route. This icon will be used in picker UIs if available. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getName()()` Gets the user-visible name of the route. The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getName(android.content.Context)(context: https://developer.android.com/reference/kotlin/android/content/Context.html#!)` Return the properly localized/resource user-visible name of this route. The route name identifies the destination represented by the route. It may be a user-supplied name, an alias, or device serial number. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getPlaybackStream()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getPlaybackType()()` <br /> | | `https://developer.android.com/reference/kotlin/android/view/Display.html#!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getPresentationDisplay()()` Gets the `https://developer.android.com/reference/kotlin/android/view/Display.html#` that should be used by the application to show a `https://developer.android.com/reference/kotlin/android/app/Presentation.html#` on an external display when this route is selected. Depending on the route, this may only be valid if the route is currently selected. The preferred presentation display may change independently of the route being selected or unselected. For example, the presentation display of the default system route may change when an external HDMI display is connected or disconnected even though the route itself has not changed. This method may return null if there is no external display associated with the route or if the display is not ready to show UI yet. The application should listen for changes to the presentation display using the `https://developer.android.com/reference/kotlin/android/media/MediaRouter.Callback#onRoutePresentationDisplayChanged(android.media.MediaRouter,%20android.media.MediaRouter.RouteInfo)` callback and show or dismiss its `https://developer.android.com/reference/kotlin/android/app/Presentation.html#` accordingly when the display becomes available or is removed. This method only makes sense for `https://developer.android.com/reference/kotlin/android/media/MediaRouter#ROUTE_TYPE_LIVE_VIDEO:kotlin.Int` routes. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getStatus()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getSupportedTypes()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getTag()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getVolume()()` Return the current volume for this route. Depending on the route, this may only be valid if the route is currently selected. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getVolumeHandling()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#getVolumeMax()()` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#isConnecting()()` Returns true if the route is in the process of connecting and is not yet ready for use. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#isEnabled()()` Returns true if this route is enabled and may be selected. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo#setTag(kotlin.Any)(tag: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!)` Set an application-specific tag object for this route. The application may use this to store arbitrary data associated with the route for internal tracking. Note that the lifespan of a route may be well past the lifespan of an Activity or other Context; take care that objects you store here will not keep more data in memory alive than you intend. <br /> | ||

## Public methods

### addRoute

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

```
open fun addRoute(route: MediaRouter.RouteInfo!): Unit
```

Add a route to this group. The route must not currently belong to another group.

| Parameters ||
|---|---|
| `route` | [MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!: route to add to this group |

### addRoute

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

```
open fun addRoute(
    route: MediaRouter.RouteInfo!, 
    insertAt: Int
): Unit
```

Add a route to this group before the specified index.

| Parameters ||
|---|---|
| `route` | [MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!: route to add |
| `insertAt` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): insert the new route before this index |

### getRouteAt

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

```
open fun getRouteAt(index: Int): MediaRouter.RouteInfo!
```

Return the route in this group at the specified index

| Parameters ||
|---|---|
| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Index to fetch |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo!` | The route at index |

### getRouteCount

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

```
open fun getRouteCount(): Int
```

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | The number of routes in this group |

### removeRoute

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

```
open fun removeRoute(route: MediaRouter.RouteInfo!): Unit
```

Remove a route from this group.

| Parameters ||
|---|---|
| `route` | [MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!: route to remove |

### removeRoute

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

```
open fun removeRoute(index: Int): Unit
```

Remove the route at the specified index from this group.

| Parameters ||
|---|---|
| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): index of the route to remove |

### requestSetVolume

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

```
open fun requestSetVolume(volume: Int): Unit
```

Request a volume change for this route.

| Parameters ||
|---|---|
| `volume` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): value between 0 and getVolumeMax |

### requestUpdateVolume

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

```
open fun requestUpdateVolume(direction: Int): Unit
```

Request an incremental volume update for this route.

| Parameters ||
|---|---|
| `direction` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Delta to apply to the current volume |

### setIconDrawable

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

```
open fun setIconDrawable(icon: Drawable!): Unit
```

Set an icon that will be used to represent this group. The system may use this icon in picker UIs or similar.

| Parameters ||
|---|---|
| `icon` | [Drawable](https://developer.android.com/reference/kotlin/android/graphics/drawable/Drawable.html#)!: icon drawable to use to represent this group |

### setIconResource

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

```
open fun setIconResource(resId: Int): Unit
```

Set an icon that will be used to represent this group. The system may use this icon in picker UIs or similar.

| Parameters ||
|---|---|
| `resId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Resource ID of an icon drawable to use to represent this group |

### toString

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

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

Returns a string representation of the object.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a string representation of the object. |