public class

NotificationManagerCompat

extends Object
java.lang.Object
   ↳ android.preview.support.v4.app.NotificationManagerCompat

Class Overview

Compatibility library for NotificationManager with fallbacks for older platforms.

To use this class, call the static function from(Context) to get a NotificationManagerCompat object, and then call one of its methods to post or cancel notifications.

Summary

Constants
String ACTION_BIND_SIDE_CHANNEL Intent action to register for on a service to receive side channel notifications.
String EXTRA_USE_SIDE_CHANNEL Notification extras key: if set to true, the posted notification should use the side channel for delivery instead of using notification manager.
Public Methods
void cancel(int id)
Cancel a previously shown notification.
void cancel(String tag, int id)
Cancel a previously shown notification.
void cancelAll()
Cancel all previously shown notifications.
static NotificationManagerCompat from(Context context)
Get a NotificationManagerCompat instance for a provided context.
static Set<String> getEnabledListenerPackages(Context context)
Get the list of packages that have an enabled notification listener component within them, with caching for performance.
void notify(int id, Notification notification)
Post a notification to be shown in the status bar, stream, etc.
void notify(String tag, int id, Notification notification)
Post a notification to be shown in the status bar, stream, etc.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION_BIND_SIDE_CHANNEL

Intent action to register for on a service to receive side channel notifications. The listening service must be in the same package as an enabled ERROR(/android.service.notification.NotificationListenerService).

Constant Value: "android.support.app.notification.BIND_SIDE_CHANNEL"

public static final String EXTRA_USE_SIDE_CHANNEL

Notification extras key: if set to true, the posted notification should use the side channel for delivery instead of using notification manager.

Constant Value: "android.preview.support.useSideChannel"

Public Methods

public void cancel (int id)

Cancel a previously shown notification.

public void cancel (String tag, int id)

Cancel a previously shown notification.

public void cancelAll ()

Cancel all previously shown notifications.

public static NotificationManagerCompat from (Context context)

Get a NotificationManagerCompat instance for a provided context.

public static Set<String> getEnabledListenerPackages (Context context)

Get the list of packages that have an enabled notification listener component within them, with caching for performance.

public void notify (int id, Notification notification)

Post a notification to be shown in the status bar, stream, etc.

public void notify (String tag, int id, Notification notification)

Post a notification to be shown in the status bar, stream, etc.