NotificationContentProviderBase

  • NotificationContentProviderBase allows clients to control the content of persistent notifications.

  • It provides a convenience method updateNotification() to push updates via ForegroundServiceManager.

  • Clients need to extend this class and implement the getNotification() method to provide the notification content.

  • The NotificationContentProviderBase constructor requires an Application object.

public abstract class NotificationContentProviderBase extends Object
implements NotificationContentProvider

Clients should extend this class if they wish to control the content of the persistent notification. If the notification content changes, updateNotification() is a convenience method which pushes the new notification via ForegroundServiceManager.

Public Constructor Summary

NotificationContentProviderBase(Application application)
Constructor

Public Method Summary

abstract Notification
getNotification()
Returns most recent version of the notification.
void
updateNotification()
Re-renders the notification after asking NotificationContentProvider for the most recent version of the notification.

Inherited Method Summary

Public Constructors

public NotificationContentProviderBase (Application application)

Constructor

Parameters
application

Public Methods

public abstract Notification getNotification ()

Returns most recent version of the notification.

public void updateNotification ()

Re-renders the notification after asking NotificationContentProvider for the most recent version of the notification. Eliminates need to call this via the ForegroundServiceManager singleton.