Android Alarm Cancel unsetAlarm(Context context, Intent intentBroadcast)

Here you can find the source of unsetAlarm(Context context, Intent intentBroadcast)

Description

unset Alarm

Declaration

public static void unsetAlarm(Context context, Intent intentBroadcast) 

Method Source Code

//package com.java2s;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class Main {
    public static void unsetAlarm(Context context, Intent intentBroadcast) {
        AlarmManager am = (AlarmManager) context
                .getSystemService(Context.ALARM_SERVICE);

        PendingIntent sender = PendingIntent.getBroadcast(context, 0,
                intentBroadcast, 0);/*w w w  . j  av a  2s . co  m*/

        am.cancel(sender);
    }

    public static void unsetAlarm(Context context,
            PendingIntent pendingIntent) {
        AlarmManager am = (AlarmManager) context
                .getSystemService(Context.ALARM_SERVICE);

        am.cancel(pendingIntent);
    }
}

Related

  1. cancelAlarm(Context context, int index, String action)
  2. cancelAlarm(PendingIntent intent, Context context)
  3. cancelAlarmManager(Context context, PendingIntent pendingIntent)
  4. cancel(Context context, Intent broadcastIntent, int requestCode)
  5. cancelAlarm(Context context, Class clazz, int flags)
  6. unsetAlarm(Context context, PendingIntent pendingIntent)
  7. unRegistAlarm(Context context, int code)