Stay organized with collections
Save and categorize content based on your preferences.
public
static
interface
MediaRouter2.OnGetControllerHintsListener
android.media.MediaRouter2.OnGetControllerHintsListener
|
A listener interface to send optional app-specific hints when creating a RoutingController
.
Summary
Public methods
public abstract Bundle onGetControllerHints (MediaRoute2Info route)
Called when the MediaRouter2
or the system is about to request a media route
provider service to create a controller with the given route. The Bundle
returned
here will be sent to media route provider service as a hint.
Since controller creation can be requested by the MediaRouter2
and the system,
set the listener as soon as possible after acquiring MediaRouter2
instance. The
method will be called on the same thread that calls MediaRouter2.transferTo(android.media.MediaRoute2Info)
or the main thread if it is requested by the system.
Parameters |
route |
MediaRoute2Info : the route to create a controller with
This value cannot be null . |
Returns |
Bundle |
An optional bundle of app-specific arguments to send to the provider, or null if none. The contents of this bundle may affect the result of controller
creation. |
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,["# MediaRouter2.OnGetControllerHintsListener\n\nAdded in [API level 30](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nMediaRouter2.OnGetControllerHintsListener\n=========================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/MediaRouter2.OnGetControllerHintsListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nMediaRouter2.OnGetControllerHintsListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------|\n| android.media.MediaRouter2.OnGetControllerHintsListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA listener interface to send optional app-specific hints when creating a [RoutingController](/reference/android/media/MediaRouter2.RoutingController).\n\nSummary\n-------\n\n| ### Public methods ||\n|----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[Bundle](/reference/android/os/Bundle) | ` `[onGetControllerHints](/reference/android/media/MediaRouter2.OnGetControllerHintsListener#onGetControllerHints(android.media.MediaRoute2Info))`(`[MediaRoute2Info](/reference/android/media/MediaRoute2Info)` route) ` Called when the [MediaRouter2](/reference/android/media/MediaRouter2) or the system is about to request a media route provider service to create a controller with the given route. |\n\nPublic methods\n--------------\n\n### onGetControllerHints\n\nAdded in [API level 30](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Bundle onGetControllerHints (MediaRoute2Info route)\n```\n\nCalled when the [MediaRouter2](/reference/android/media/MediaRouter2) or the system is about to request a media route\nprovider service to create a controller with the given route. The [Bundle](/reference/android/os/Bundle) returned\nhere will be sent to media route provider service as a hint.\n\nSince controller creation can be requested by the [MediaRouter2](/reference/android/media/MediaRouter2) and the system,\nset the listener as soon as possible after acquiring [MediaRouter2](/reference/android/media/MediaRouter2) instance. The\nmethod will be called on the same thread that calls [MediaRouter2.transferTo(android.media.MediaRoute2Info)](/reference/android/media/MediaRouter2#transferTo(android.media.MediaRoute2Info))\nor the main thread if it is requested by the system.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------|\n| `route` | `MediaRoute2Info`: the route to create a controller with This value cannot be `null`. \u003cbr /\u003e |\n\n| Returns ||\n|----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Bundle](/reference/android/os/Bundle) | An optional bundle of app-specific arguments to send to the provider, or `null` if none. The contents of this bundle may affect the result of controller creation. \u003cbr /\u003e |\n\n**See also:**\n\n- [MediaRoute2ProviderService.onCreateSession(long, String, String, Bundle)](/reference/android/media/MediaRoute2ProviderService#onCreateSession(long,%20java.lang.String,%20java.lang.String,%20android.os.Bundle))"]]