Example usage for android.content Context NOTIFICATION_SERVICE

List of usage examples for android.content Context NOTIFICATION_SERVICE

Introduction

In this page you can find the example usage for android.content Context NOTIFICATION_SERVICE.

Prototype

String NOTIFICATION_SERVICE

To view the source code for android.content Context NOTIFICATION_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.app.NotificationManager for informing the user of background events.

Usage

From source file:Main.java

public static void cancelNotification(Context ctx, int notifyId) {
    String ns = Context.NOTIFICATION_SERVICE;
    NotificationManager nMgr = (NotificationManager) ctx.getSystemService(ns);
    nMgr.cancel(notifyId);/*ww  w . ja  v  a2 s .c  o  m*/
}

From source file:Main.java

public static final void cancel(Context context, int id) {
    ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).cancel(id);
}

From source file:Main.java

public static void cancelAllNotification(Context context) {
    ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).cancelAll();
}

From source file:Main.java

public static void clearNotification(Context context, int id) {
    ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).cancel(id);
}

From source file:Main.java

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

From source file:Main.java

public static NotificationManager getNotificationManager(Context mContext) {
    return (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
}

From source file:Main.java

public static void removeNotification(Context context, int id) {
    NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
    manager.cancel(id);/*from   w ww. j a v a  2  s .  co  m*/
}

From source file:Main.java

public static NotificationManager getNotificationManager() {
    return (NotificationManager) Appcontext.getSystemService(Context.NOTIFICATION_SERVICE);
}

From source file:Main.java

public static void cancellAllNotifications(Context context) {
    NotificationManager mNotifyMgr = (NotificationManager) context
            .getSystemService(Context.NOTIFICATION_SERVICE);
    mNotifyMgr.cancelAll();//from  ww  w.  j  ava  2s.c o m
}

From source file:Main.java

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

    notificationManager.cancel(1);//from w w  w . j  av  a 2s  .c  om
}