Most visited

Recently visited

MediaRouteChooserDialogFragment

public class MediaRouteChooserDialogFragment
extends DialogFragment

java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ android.support.v4.app.DialogFragment
       ↳ android.support.v7.app.MediaRouteChooserDialogFragment


媒体路由选择器对话框片段。

创建一个MediaRouteChooserDialog 该应用程序可以继承此对话框片段以定制媒体路径选择器对话框。

Summary

Inherited constants

From class android.support.v4.app.DialogFragment

Public constructors

MediaRouteChooserDialogFragment()

创建媒体路由选择器对话框片段。

Public methods

MediaRouteSelector getRouteSelector()

获取媒体路由选择器,用于过滤用户可以选择的路由。

void onConfigurationChanged(Configuration newConfig)

设备配置在组件运行时发生更改时由系统调用。

MediaRouteChooserDialog onCreateChooserDialog(Context context, Bundle savedInstanceState)

在创建选择器对话框时调用。

Dialog onCreateDialog(Bundle savedInstanceState)

重写以构建您自己的自定义Dialog容器。

void setRouteSelector(MediaRouteSelector selector)

设置媒体路由选择器,用于过滤用户可以选择的路由。

Inherited methods

From class android.support.v4.app.DialogFragment
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.content.DialogInterface.OnCancelListener
From interface android.content.DialogInterface.OnDismissListener
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener

Public constructors

MediaRouteChooserDialogFragment

MediaRouteChooserDialogFragment ()

创建媒体路由选择器对话框片段。

这个类的所有子类都必须拥有一个默认的构造函数。

Public methods

getRouteSelector

MediaRouteSelector getRouteSelector ()

获取媒体路由选择器,用于过滤用户可以选择的路由。

Returns
MediaRouteSelector The selector, never null.

onConfigurationChanged

void onConfigurationChanged (Configuration newConfig)

设备配置在组件运行时发生更改时由系统调用。 请注意,与活动不同,当配置更改时,其他组件不会重新启动:它们必须始终处理更改的结果,例如通过重新获取资源。

在调用此函数时,您的Resources对象将被更新为返回与新配置相匹配的资源值。

欲了解更多信息,请阅读 Handling Runtime Changes

Parameters
newConfig Configuration: The new device configuration.

onCreateChooserDialog

MediaRouteChooserDialog onCreateChooserDialog (Context context, 
                Bundle savedInstanceState)

在创建选择器对话框时调用。

子类可以重写此方法来自定义对话框。

Parameters
context Context
savedInstanceState Bundle
Returns
MediaRouteChooserDialog

onCreateDialog

Dialog onCreateDialog (Bundle savedInstanceState)

重写以构建您自己的自定义Dialog容器。 这通常用于显示AlertDialog而不是通用的Dialog; 这样做时,由于AlertDialog负责处理自己的内容, onCreateView(LayoutInflater, ViewGroup, Bundle)不需要执行onCreateView(LayoutInflater, ViewGroup, Bundle)

该方法将在onCreate(Bundle)之后和onCreateView(LayoutInflater, ViewGroup, Bundle)之前onCreateView(LayoutInflater, ViewGroup, Bundle) 默认实现只是实例化并返回一个Dialog类。

注意:DialogFragment拥有Dialog.setOnCancelListenerDialog.setOnDismissListener回调。 你不能自己设置它们。 要了解这些事件,请覆盖onCancel(DialogInterface)onDismiss(DialogInterface)

Parameters
savedInstanceState Bundle: The last saved instance state of the Fragment, or null if this is a freshly created Fragment.
Returns
Dialog Return a new Dialog instance to be displayed by the Fragment.

setRouteSelector

void setRouteSelector (MediaRouteSelector selector)

设置媒体路由选择器,用于过滤用户可以选择的路由。 必须在添加片段之前调用此方法。

Parameters
selector MediaRouteSelector: The selector to set.

Hooray!