belongs to Maven artifact com.android.support:mediarouter-v7:28.0.0-alpha1
MediaRouteProviderService
public
abstract
class
MediaRouteProviderService
extends Service
java.lang.Object | ||||
↳ | android.content.Context | |||
↳ | android.content.ContextWrapper | |||
↳ | android.app.Service | |||
↳ | android.support.v7.media.MediaRouteProviderService |
Base class for media route provider services.
A media router will bind to media route provider services when a callback is added via
addCallback(MediaRouteSelector, MediaRouter.Callback, int)
with a discovery
flag: CALLBACK_FLAG_REQUEST_DISCOVERY
,
CALLBACK_FLAG_FORCE_DISCOVERY
, or
CALLBACK_FLAG_PERFORM_ACTIVE_SCAN
, and will unbind when the callback
is removed via removeCallback(MediaRouter.Callback)
.
To implement your own media route provider service, extend this class and
override the onCreateMediaRouteProvider()
method to return an
instance of your MediaRouteProvider
.
Declare your media route provider service in your application manifest like this:
<service android:name=".MyMediaRouteProviderService" android:label="@string/my_media_route_provider_service"> <intent-filter> <action android:name="android.media.MediaRouteProviderService" /> </intent-filter> </service>
Summary
Constants | |
---|---|
String |
SERVICE_INTERFACE
The |
Inherited constants |
---|
![]()
android.app.Service
|
![]()
android.content.Context
|
![]()
android.content.ComponentCallbacks2
|
Public constructors | |
---|---|
MediaRouteProviderService()
Creates a media route provider service. |
Public methods | |
---|---|
MediaRouteProvider
|
getMediaRouteProvider()
Gets the media route provider offered by this service. |
IBinder
|
onBind(Intent intent)
|
abstract
MediaRouteProvider
|
onCreateMediaRouteProvider()
Called by the system when it is time to create the media route provider. |
boolean
|
onUnbind(Intent intent)
|
Inherited methods | |
---|---|
![]()
android.app.Service
| |
![]()
android.content.ContextWrapper
|