语言

MediaRouter2.SetRouteListingPreference(RouteListingPreference) 方法

定义

RouteListingPreference设置与此媒体路由器关联的应用。

[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

参数

routeListingPreference
RouteListingPreference

RouteListingPreference要用于路由列表的系统。 如果为 null,则系统使用其默认列表条件。

特性

注解

RouteListingPreference设置与此媒体路由器关联的应用。

使用此方法通过输出交换机通知系统 UI 要列出媒体路由的路由。

应在收到任何RouteCallback#onRoutesUpdated route updates方法之前#registerRouteCallback registering any route callbacks和之后立即调用此方法,以使系统 UI 保持一致状态。 还可以在任何其他点调用此方法以动态更新列表首选项。

在代理路由器实例上调用此方法将引发一个 UnsupportedOperationException。

Notes:

<ol><li>You should not include the id of two or more route with a match in their MediaRoute2Info#getDeduplicationIds() deduplication ids. 如果这样做,系统会使用自己的条件删除重复数据。 <li>可以使用此方法在输出切换器中对路由进行排名,首先放置更重要的路由。 系统可能会覆盖建议的排名。 <li>可以使用此方法避免使用动态条件列出路由。 例如,可以根据运行时条件限制对特定类型的设备的访问。 </ol>

Java文档android.media.MediaRouter2.setRouteListingPreference(android.media.RouteListingPreference)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于