Stay organized with collections
Save and categorize content based on your preferences.
OnActiveSessionsChangedListener
interface OnActiveSessionsChangedListener
Listens for changes to the list of active sessions. This can be added using #addOnActiveSessionsChangedListener.
Summary
Public methods |
abstract Unit |
|
Public methods
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaSessionManager.OnActiveSessionsChangedListener\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnActiveSessionsChangedListener\n===============================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/session/MediaSessionManager.OnActiveSessionsChangedListener \"View this page in Java\") \n\n```\ninterface OnActiveSessionsChangedListener\n```\n\n|--------------------------------------------------------------------------------|\n| [android.media.session.MediaSessionManager.OnActiveSessionsChangedListener](#) |\n\nListens for changes to the list of active sessions. This can be added using #addOnActiveSessionsChangedListener.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onActiveSessionsChanged](#onActiveSessionsChanged(kotlin.collections.MutableList))`(`controllers:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[MediaController](/reference/kotlin/android/media/session/MediaController)!\u003e?`)` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### onActiveSessionsChanged\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onActiveSessionsChanged(controllers: MutableList\u003cMediaController!\u003e?): Unit\n```\n\n| Parameters ||\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `controllers` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[MediaController](/reference/kotlin/android/media/session/MediaController)!\\\u003e?: This value may be `null`. |"]]