다음을 통해 공유


MediaRouter2.SetRouteListingPreference(RouteListingPreference) Method

Definition

Sets the RouteListingPreference of the app associated to this media router.

[Android.Runtime.Register("setRouteListingPreference", "(Landroid/media/RouteListingPreference;)V", "", ApiSince=34)]
public void SetRouteListingPreference (Android.Media.RouteListingPreference? routeListingPreference);
[<Android.Runtime.Register("setRouteListingPreference", "(Landroid/media/RouteListingPreference;)V", "", ApiSince=34)>]
member this.SetRouteListingPreference : Android.Media.RouteListingPreference -> unit

Parameters

routeListingPreference
RouteListingPreference

The RouteListingPreference for the system to use for route listing. When null, the system uses its default listing criteria.

Attributes

Remarks

Sets the RouteListingPreference of the app associated to this media router.

Use this method to inform the system UI of the routes that you would like to list for media routing, via the Output Switcher.

You should call this method before #registerRouteCallback registering any route callbacks and immediately after receiving any RouteCallback#onRoutesUpdated route updates in order to keep the system UI in a consistent state. You can also call this method at any other point to update the listing preference dynamically.

Notes:

<ol> <li>You should not include the ids of two or more routes with a match in their MediaRoute2Info#getDeduplicationIds() deduplication ids. If you do, the system will deduplicate them using its own criteria. <li>You can use this method to rank routes in the output switcher, placing the more important routes first. The system might override the proposed ranking. <li>You can use this method to avoid listing routes using dynamic criteria. For example, you can limit access to a specific type of device according to runtime criteria. </ol>

Java documentation for android.media.MediaRouter2.setRouteListingPreference(android.media.RouteListingPreference).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to