# MediaRouter.RouteCategory

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

# RouteCategory

*** ** * ** ***

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

```
open class RouteCategory
```

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

Definition of a category of routes. All routes belong to a category.

## Summary

|                                                                                                                                                                                                                                                                                                                                               Public methods                                                                                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!                                                                                                                           | [getName](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory#getName())`()` <br />                                                                                                                                                                                                                                                                                                                                                       |
| open[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!                                                                                                                           | [getName](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory#getName(android.content.Context))`(`context:` `[Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!`)` Return the properly localized/configuration dependent name of this RouteCategory.                                                                                                                                                |
| open[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!\>! | [getRoutes](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory#getRoutes(kotlin.collections.MutableList))`(`out:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!>!`)` Return the current list of routes in this category that have been added to the MediaRouter. |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                               | [getSupportedTypes](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory#getSupportedTypes())`()` <br />                                                                                                                                                                                                                                                                                                                                   |
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                                       | [isGroupable](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory#isGroupable())`()` Return whether or not this category supports grouping.                                                                                                                                                                                                                                                                                               |
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                         | [toString](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteCategory#toString())`()` <br />                                                                                                                                                                                                                                                                                                                                                     |

## Public methods

### getName

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

```
open fun getName(): CharSequence!
```

|                                                             Return                                                              ||
|------------------------------------------------------------------------------------------------|---------------------------------|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | the name of this route category |

### getName

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

```
open fun getName(context: Context!): CharSequence!
```

Return the properly localized/configuration dependent name of this RouteCategory.

|                                                              Parameters                                                               ||
|-----------|----------------------------------------------------------------------------------------------------------------------------|
| `context` | [Context](https://developer.android.com/reference/kotlin/android/content/Context.html#)!:Context to resolve name resources |

|                                                             Return                                                              ||
|------------------------------------------------------------------------------------------------|---------------------------------|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)! | the name of this route category |

### getRoutes

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

```
open fun getRoutes(out: MutableList<MediaRouter.RouteInfo!>!): MutableList<MediaRouter.RouteInfo!>!
```

Return the current list of routes in this category that have been added to the MediaRouter.

This list will not include routes that are nested within RouteGroups. A RouteGroup is treated as a single route within its category.

|                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                               ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `out` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!\>!:a List to fill with the routes in this category. If this parameter is non-null, it will be cleared, filled with the current routes with this category, and returned. If this parameter is null, a new List will be allocated to report the category's current routes. |

|                                                                                                                                                  Return                                                                                                                                                  ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[MediaRouter.RouteInfo](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteInfo)!>! | A list with the routes in this category that have been added to the MediaRouter. |

### getSupportedTypes

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

```
open fun getSupportedTypes(): Int
```

|                                                                   Return                                                                   ||
|----------------------------------------------------------------------------|----------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Flag set describing the route types supported by this category |

### isGroupable

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

```
open fun isGroupable(): Boolean
```

Return whether or not this category supports grouping.

If this method returns true, all routes obtained from this category via calls to[getRouteAt(int)](https://developer.android.com/reference/kotlin/android/media/MediaRouter#getRouteAt(kotlin.Int))will be[MediaRouter.RouteGroup](https://developer.android.com/reference/kotlin/android/media/MediaRouter.RouteGroup)s.

|                                                       Return                                                       ||
|------------------------------------------------------------------------------------|--------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if this category supports |

### toString

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

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

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