Stay organized with collections
Save and categorize content based on your preferences.
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nMediaSessionManager.OnActiveSessionsChangedListener\n===================================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/session/MediaSessionManager.OnActiveSessionsChangedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nMediaSessionManager.OnActiveSessionsChangedListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------------------------|\n| android.media.session.MediaSessionManager.OnActiveSessionsChangedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nListens for changes to the list of active sessions. This can be added\nusing [MediaSessionManager.addOnActiveSessionsChangedListener(OnActiveSessionsChangedListener, ComponentName)](/reference/android/media/session/MediaSessionManager#addOnActiveSessionsChangedListener(android.media.session.MediaSessionManager.OnActiveSessionsChangedListener,%20android.content.ComponentName)).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onActiveSessionsChanged](/reference/android/media/session/MediaSessionManager.OnActiveSessionsChangedListener#onActiveSessionsChanged(java.util.List\u003candroid.media.session.MediaController\u003e))`(`[List](/reference/java/util/List)`\u003c`[MediaController](/reference/android/media/session/MediaController)`\u003e controllers) ` |\n\nPublic methods\n--------------\n\n### onActiveSessionsChanged\n\nAdded in [API level 21](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onActiveSessionsChanged (List\u003cMediaController\u003e controllers)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------|------------------------------------------|\n| `controllers` | `List`: This value may be `null`. \u003cbr /\u003e |"]]