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,["# MediaRouteDialogFactory\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:mediarouter-v7:28.0.0-alpha1 \nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nMediaRouteDialogFactory\n=======================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\n\nclass\nMediaRouteDialogFactory\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------------|\n| java.lang.Object ||\n| ↳ | android.support.v7.app.MediaRouteDialogFactory |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThe media route dialog factory is responsible for creating the media route\nchooser and controller dialogs as needed.\n\n\nThe application can customize the dialogs by providing a subclass of the\ndialog factory to the [MediaRouteButton](/reference/android/support/v7/app/MediaRouteButton) using the\n[setDialogFactory](/reference/android/support/v7/app/MediaRouteButton#setDialogFactory(android.support.v7.app.MediaRouteDialogFactory)) method.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public constructors ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[MediaRouteDialogFactory](/reference/android/support/v7/app/MediaRouteDialogFactory#MediaRouteDialogFactory())`() ` Creates a default media route dialog factory. |\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static `[MediaRouteDialogFactory](/reference/android/support/v7/app/MediaRouteDialogFactory) | ` `[getDefault](/reference/android/support/v7/app/MediaRouteDialogFactory#getDefault())`() ` Gets the default factory instance. |\n| ` `[MediaRouteChooserDialogFragment](/reference/android/support/v7/app/MediaRouteChooserDialogFragment) | ` `[onCreateChooserDialogFragment](/reference/android/support/v7/app/MediaRouteDialogFactory#onCreateChooserDialogFragment())`() ` Called when the chooser dialog is being opened and it is time to create the fragment. |\n| ` `[MediaRouteControllerDialogFragment](/reference/android/support/v7/app/MediaRouteControllerDialogFragment) | ` `[onCreateControllerDialogFragment](/reference/android/support/v7/app/MediaRouteDialogFactory#onCreateControllerDialogFragment())`() ` Called when the controller dialog is being opened and it is time to create the fragment. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic constructors\n-------------------\n\n### MediaRouteDialogFactory\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nMediaRouteDialogFactory ()\n```\n\nCreates a default media route dialog factory.\n\n\u003cbr /\u003e\n\nPublic methods\n--------------\n\n### getDefault\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nMediaRouteDialogFactory getDefault ()\n```\n\nGets the default factory instance.\n\n\u003cbr /\u003e\n\n| Returns ||\n|--------------------------------------------------------------------------------------|------------------------------------------------------------|\n| [MediaRouteDialogFactory](/reference/android/support/v7/app/MediaRouteDialogFactory) | The default media route dialog factory, never null. \u003cbr /\u003e |\n\n### onCreateChooserDialogFragment\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nMediaRouteChooserDialogFragment onCreateChooserDialogFragment ()\n```\n\nCalled when the chooser dialog is being opened and it is time to create the fragment.\n\n\nSubclasses may override this method to create a customized fragment.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|\n| [MediaRouteChooserDialogFragment](/reference/android/support/v7/app/MediaRouteChooserDialogFragment) | The media route chooser dialog fragment, must not be null. \u003cbr /\u003e |\n\n### onCreateControllerDialogFragment\n\nadded in [version 22.1.0](/topic/libraries/support-library/revisions) \n\n```\nMediaRouteControllerDialogFragment onCreateControllerDialogFragment ()\n```\n\nCalled when the controller dialog is being opened and it is time to create the fragment.\n\n\nSubclasses may override this method to create a customized fragment.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------|\n| [MediaRouteControllerDialogFragment](/reference/android/support/v7/app/MediaRouteControllerDialogFragment) | The media route controller dialog fragment, must not be null. \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [ActionBar.OnMenuVisibilityListener](/reference/android/support/v7/app/ActionBar.OnMenuVisibilityListener)\n - [ActionBar.OnNavigationListener](/reference/android/support/v7/app/ActionBar.OnNavigationListener)\n - [ActionBar.TabListener](/reference/android/support/v7/app/ActionBar.TabListener)\n - [ActionBarDrawerToggle.Delegate](/reference/android/support/v7/app/ActionBarDrawerToggle.Delegate)\n - [ActionBarDrawerToggle.DelegateProvider](/reference/android/support/v7/app/ActionBarDrawerToggle.DelegateProvider)\n - [AppCompatCallback](/reference/android/support/v7/app/AppCompatCallback)\n-\n\n Classes\n -------\n\n - [ActionBar](/reference/android/support/v7/app/ActionBar)\n - [ActionBar.LayoutParams](/reference/android/support/v7/app/ActionBar.LayoutParams)\n - [ActionBar.Tab](/reference/android/support/v7/app/ActionBar.Tab)\n - [ActionBarDrawerToggle](/reference/android/support/v7/app/ActionBarDrawerToggle)\n - [AlertDialog](/reference/android/support/v7/app/AlertDialog)\n - [AlertDialog.Builder](/reference/android/support/v7/app/AlertDialog.Builder)\n - [AppCompatActivity](/reference/android/support/v7/app/AppCompatActivity)\n - [AppCompatDelegate](/reference/android/support/v7/app/AppCompatDelegate)\n - [AppCompatDialog](/reference/android/support/v7/app/AppCompatDialog)\n - [AppCompatDialogFragment](/reference/android/support/v7/app/AppCompatDialogFragment)\n - [AppCompatViewInflater](/reference/android/support/v7/app/AppCompatViewInflater)\n - [MediaRouteActionProvider](/reference/android/support/v7/app/MediaRouteActionProvider)\n - [MediaRouteButton](/reference/android/support/v7/app/MediaRouteButton)\n - [MediaRouteChooserDialog](/reference/android/support/v7/app/MediaRouteChooserDialog)\n - [MediaRouteChooserDialogFragment](/reference/android/support/v7/app/MediaRouteChooserDialogFragment)\n - [MediaRouteControllerDialog](/reference/android/support/v7/app/MediaRouteControllerDialog)\n - [MediaRouteControllerDialogFragment](/reference/android/support/v7/app/MediaRouteControllerDialogFragment)\n - [MediaRouteDialogFactory](/reference/android/support/v7/app/MediaRouteDialogFactory)\n - [MediaRouteDiscoveryFragment](/reference/android/support/v7/app/MediaRouteDiscoveryFragment)"]]