Stay organized with collections
Save and categorize content based on your preferences.
open class MediaRouteActionProvider : ActionProvider
The media route action provider displays a media route button
in the application's ActionBar
to allow the user to select routes and to control the currently selected route.
The application must specify the kinds of routes that the user should be allowed to select by specifying the route types with the setRouteTypes
method.
Refer to MediaRouteButton
for a description of the button that will appear in the action bar menu. Note that instead of disabling the button when no routes are available, the action provider will instead make the menu item invisible. In this way, the button will only be visible when it is possible for the user to discover and select a matching route.
Summary
Public methods |
open Boolean |
|
open View |
|
open View |
|
open Boolean |
|
open Boolean |
|
open Unit |
|
open Unit |
Sets the types of routes that will be shown in the media route chooser dialog launched by this button.
|
Public constructors
MediaRouteActionProvider(context: Context!)
Public methods
isVisible
open fun isVisible(): Boolean
Return |
Boolean |
true if the MenuItem this ActionProvider is bound to is visible, false if it is invisible. The default implementation returns true. |
onCreateActionView
open fun onCreateActionView(): View
Return |
View |
A new action view. This value cannot be null . |
onCreateActionView
open fun onCreateActionView(item: MenuItem): View
Parameters |
forItem |
MenuItem to create the action view for This value cannot be null . |
Return |
View |
the new action view This value cannot be null . |
open fun onPerformDefaultAction(): Boolean
overridesItemVisibility
open fun overridesItemVisibility(): Boolean
Return |
Boolean |
true if this ActionProvider overrides the visibility of the MenuItem it is bound to, false otherwise. The default implementation returns false. |
setRouteTypes
open fun setRouteTypes(types: Int): Unit
Sets the types of routes that will be shown in the media route chooser dialog launched by this button.
Parameters |
types |
Int: The route types to match. |
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 2024-04-04 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 2024-04-04 UTC."],[],[]]