Example #1
0
  /** Delete or reschedule a specific notification. */
  public static void deleteOrReschedule(final Context context, final Uri uri) {
    final Cursor c = context.getContentResolver().query(uri, Columns.FIELDS, null, null, null);

    while (c.moveToNext()) {
      Notification n = new Notification(c);
      n.deleteOrReschedule(context);
    }
    c.close();
  }
Example #2
0
 private void clearNotification(final Intent intent) {
   if (intent != null && intent.getLongExtra(NOTIFICATION_DELETE_ARG, -1) > 0) {
     Notification.deleteOrReschedule(
         this, Notification.getUri(intent.getLongExtra(NOTIFICATION_DELETE_ARG, -1)));
   }
   if (intent != null && intent.getLongExtra(NOTIFICATION_CANCEL_ARG, -1) > 0) {
     NotificationHelper.cancelNotification(
         this, (int) intent.getLongExtra(NOTIFICATION_CANCEL_ARG, -1));
   }
 }