MediaNotificationManager
Stay organized with collections
Save and categorize content based on your preferences.
A class that manages the media notification.
Call
CastContext.getMediaNotificationManager()
to get the instance of this class.
Call
updateNotification()
to update the media notification. You don't need to call that
method if there is no custom action in the media notification. If you do implement custom
actions, call
updateNotification()
when needed to rebuild the media notification using
NotificationActionsProvider
. See
NotificationActionsProvider
for how to add custom actions in the media
notification.
// Update the notification when needed.
CastContext castContext = getSharedInstance(applicationContext);
castContext.getMediaNotificationManager().updateNotification();
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
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()
|
Public Methods
public void updateNotification ()
Updates the current media notification if it is already started. Otherwise, starts a
new media notification.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 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-10-31 UTC."],[[["`MediaNotificationManager` is a class used for managing media notifications in Android applications using the Google Cast framework."],["You can get an instance of this class using `CastContext.getMediaNotificationManager()`."],["Call `updateNotification()` to refresh the media notification, especially when custom actions are implemented using `NotificationActionsProvider`."],["If no custom actions are added, you do not need to explicitly call `updateNotification()`."]]],["The `MediaNotificationManager` class manages media notifications, retrievable via `CastContext.getMediaNotificationManager()`. To update the media notification, call the `updateNotification()` method, especially when custom actions are added via `NotificationActionsProvider`. If no custom actions are needed, manual updates aren't required. `updateNotification()` either updates an existing notification or starts a new one. It is also possible to access several inherited methods from `java.lang.Object`.\n"]]