Example usage for android.app NotificationManager cancel

List of usage examples for android.app NotificationManager cancel

Introduction

In this page you can find the example usage for android.app NotificationManager cancel.

Prototype

public void cancel(int id) 

Source Link

Document

Cancel a previously shown notification.

Usage

From source file:ezy.assist.app.NotifyUtil.java

public static void cancel(Context context, int notifyId) {
    NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    manager.cancel(notifyId);
}

From source file:org.mozilla.gecko.GuestSession.java

public static void hideNotification(Context context) {
    final NotificationManager manager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    manager.cancel(R.id.guestNotification);
}

From source file:io.github.guaidaodl.pomodorotimer.utils.NotificationHelper.java

public static void cancelBreakNotification(Context context) {
    NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

    manager.cancel(NOTIFICATION_ID_BREAK);
}

From source file:com.innoc.secureline.ui.NotificationBarManager.java

public static void setCallEnded(Context context) {
    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);

    notificationManager.cancel(RED_PHONE_NOTIFICATION);
}

From source file:org.openintents.safe.service.ServiceNotification.java

public static void clearNotification(Context context) {

    // look up the notification manager service
    NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    nm.cancel(NOTIFICATION_ID);
}

From source file:com.google.android.apps.muzei.NewWallpaperNotificationReceiver.java

public static void markNotificationRead(Context context) {
    SourceManager sm = SourceManager.getInstance(context);
    SourceState state = sm.getSelectedSourceState();
    Artwork currentArtwork = (state == null) ? null : state.getCurrentArtwork();
    if (currentArtwork == null || currentArtwork.getImageUri() == null) {
        return;/* w ww  .j av  a2 s . c  o m*/
    }

    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
    sp.edit().putString(PREF_LAST_SEEN_NOTIFICATION_IMAGE_URI, currentArtwork.getImageUri().toString()).apply();

    NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    nm.cancel(NOTIFICATION_ID);
}

From source file:com.heightechllc.breakify.AlarmNotifications.java

/**
 * Hides any currently visible notification that was shown by this app. You don't need to call
 *  this before you show a different notification in this class, since all notifications here
 *  use the same id, so the new one will overwrite the old one.
 *//*from  w w w.  j a v  a2  s . c om*/
public static void hideNotification(Context context) {
    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancel(notificationID);
}

From source file:org.anhonesteffort.flock.sync.key.KeySyncUtil.java

public static void cancelCipherPassphraseNotification(Context context) {
    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.cancel(ID_NOTIFICATION_CIPHER_PASSPHRASE);
}

From source file:org.anhonesteffort.flock.sync.key.KeySyncService.java

public static void cancelCipherPassphraseNotification(Context context) {
    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);

    notificationManager.cancel(ID_NOTIFICATION_CIPHER_PASSPHRASE);
}

From source file:org.jorge.lolin1.func.chat.ChatNotificationManager.java

public static synchronized void dismissNotifications(Context context, String friendName) {
    NotificationManager notificationManager = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    if (NOTIFICATION_ID_MAP.containsKey(friendName)) {
        notificationManager.cancel(NOTIFICATION_ID_MAP.remove(friendName));
        LAST_NOTIFICATION_CONTENTS.remove(friendName);
    }//from   w w w. j a  v  a2s  . co m
}