Java tutorial
//package com.java2s; //License from project: Open Source License import android.app.NotificationManager; import android.content.Context; public class Main { public static void cancel(int id, Context context) { getNotificationManager(context).cancel(id); } private static NotificationManager getNotificationManager(Context context) { NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); return notificationManager; } }