Android Utililty Methods Alarm Cancel

List of utility methods to do Alarm Cancel

Description

The list of methods to do Alarm Cancel are organized into topic(s).

Method

voidcancelAlarm(Context context, int index, String action)
cancel Alarm
Intent intent = new Intent(action);
intent.putExtra("index", index);
PendingIntent sender = PendingIntent.getBroadcast(context, index,
        intent, 0);
AlarmManager am = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
am.cancel(sender);
voidcancelAlarm(PendingIntent intent, Context context)
cancel Alarm
AlarmManager am = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
am.cancel(intent);
voidcancelAlarmManager(Context context, PendingIntent pendingIntent)
cancel Alarm Manager
AlarmManager alarmManager = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
pendingIntent.cancel();
alarmManager.cancel(pendingIntent);
voidcancel(Context context, Intent broadcastIntent, int requestCode)
cancel
PendingIntent sender = genPendingBroadcast(context, requestCode,
        broadcastIntent);
AlarmManager am = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
am.cancel(sender);
voidcancelAlarm(Context context, Class clazz, int flags)
cancel Alarm
AlarmManager alarmManager = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, clazz);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
        0, intent, flags);
alarmManager.cancel(pendingIntent);
pendingIntent.cancel();
voidunsetAlarm(Context context, Intent intentBroadcast)
unset Alarm
AlarmManager am = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
PendingIntent sender = PendingIntent.getBroadcast(context, 0,
        intentBroadcast, 0);
am.cancel(sender);
voidunsetAlarm(Context context, PendingIntent pendingIntent)
unset Alarm
AlarmManager am = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
am.cancel(pendingIntent);
voidunRegistAlarm(Context context, int code)
un Regist Alarm
Intent intent = new Intent();
PendingIntent sender = PendingIntent.getBroadcast(context, code,
        intent, 0);
AlarmManager manager = (AlarmManager) context
        .getSystemService(Context.ALARM_SERVICE);
manager.cancel(sender);