cancel All Notification - Android Android OS

Android examples for Android OS:Notification Cancel

Description

cancel All Notification

Demo Code


import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.support.v7.app.NotificationCompat;

public class Main{
    public static void cancelAll(Context context) {
        NotificationManager notificationManager = (NotificationManager) context
                .getSystemService(Context.NOTIFICATION_SERVICE);
        notificationManager.cancelAll();
    }/*from  w w w . ja va 2  s.c  o  m*/
}

Related Tutorials