Example usage for android.service.notification NotificationListenerService getActiveNotifications

List of usage examples for android.service.notification NotificationListenerService getActiveNotifications

Introduction

In this page you can find the example usage for android.service.notification NotificationListenerService getActiveNotifications.

Prototype

public StatusBarNotification[] getActiveNotifications() 

Source Link

Document

Request the list of outstanding notifications (that is, those that are visible to the current user).

Usage

From source file:com.achep.acdisplay.notifications.NotificationListenerJellyBeanMR2.java

@SuppressWarnings("BooleanMethodIsAlwaysInverted")
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
private boolean postActiveNotifications(@NonNull NotificationListenerService service) {
    StatusBarNotification[] an = service.getActiveNotifications();
    if (an == null)
        return false;
    NotificationPresenter np = NotificationPresenter.getInstance();
    np.init(service, an);//from www.  j a v a  2 s  .  co  m
    return mInitialized = true;
}