Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:mediarouter-v7:27.0.0

MediaRouteChooserDialogFragment

public class MediaRouteChooserDialogFragment
extends DialogFragment

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


Media route chooser dialog fragment.

Creates a MediaRouteChooserDialog. The application may subclass this dialog fragment to customize the media route chooser dialog.

Summary

Inherited constants

From class android.support.v4.app.DialogFragment

Public constructors

MediaRouteChooserDialogFragment()

Creates a media route chooser dialog fragment.

Public methods

MediaRouteSelector getRouteSelector()

Gets the media route selector for filtering the routes that the user can select.

void onConfigurationChanged(Configuration newConfig)
MediaRouteChooserDialog onCreateChooserDialog(Context context, Bundle savedInstanceState)

Called when the chooser dialog is being created.

Dialog onCreateDialog(Bundle savedInstanceState)

Override to build your own custom Dialog container.

void setRouteSelector(MediaRouteSelector selector)

Sets the media route selector for filtering the routes that the user can select.

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
From interface android.arch.lifecycle.LifecycleOwner

Public constructors

MediaRouteChooserDialogFragment

added in version 22.1.0
MediaRouteChooserDialogFragment ()

Creates a media route chooser dialog fragment.

All subclasses of this class must also possess a default constructor.

Public methods

getRouteSelector

added in version 22.1.0
MediaRouteSelector getRouteSelector ()

Gets the media route selector for filtering the routes that the user can select.

Returns
MediaRouteSelector The selector, never null.

onConfigurationChanged

added in version 22.1.0
void onConfigurationChanged (Configuration newConfig)

Parameters
newConfig Configuration

onCreateChooserDialog

added in version 22.1.0
MediaRouteChooserDialog onCreateChooserDialog (Context context, 
                Bundle savedInstanceState)

Called when the chooser dialog is being created.

Subclasses may override this method to customize the dialog.

Parameters
context Context

savedInstanceState Bundle

Returns
MediaRouteChooserDialog

onCreateDialog

added in version 22.1.0
Dialog onCreateDialog (Bundle savedInstanceState)

Override to build your own custom Dialog container. This is typically used to show an AlertDialog instead of a generic Dialog; when doing so, onCreateView(LayoutInflater, ViewGroup, Bundle) does not need to be implemented since the AlertDialog takes care of its own content.

This method will be called after onCreate(Bundle) and before onCreateView(LayoutInflater, ViewGroup, Bundle). The default implementation simply instantiates and returns a Dialog class.

Note: DialogFragment own the Dialog.setOnCancelListener and Dialog.setOnDismissListener callbacks. You must not set them yourself. To find out about these events, override onCancel(DialogInterface) and 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

added in version 22.1.0
void setRouteSelector (MediaRouteSelector selector)

Sets the media route selector for filtering the routes that the user can select. This method must be called before the fragment is added.

Parameters
selector MediaRouteSelector: The selector to set.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)