List of utility methods to do Alarm Cancel
void | cancelAlarm(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); |
void | cancelAlarm(PendingIntent intent, Context context) cancel Alarm AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.cancel(intent); |
void | cancelAlarmManager(Context context, PendingIntent pendingIntent) cancel Alarm Manager AlarmManager alarmManager = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); pendingIntent.cancel(); alarmManager.cancel(pendingIntent); |
void | cancel(Context context, Intent broadcastIntent, int requestCode) cancel PendingIntent sender = genPendingBroadcast(context, requestCode, broadcastIntent); AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.cancel(sender); |
void | cancelAlarm(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();
|
void | unsetAlarm(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); |
void | unsetAlarm(Context context, PendingIntent pendingIntent) unset Alarm AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.cancel(pendingIntent); |
void | unRegistAlarm(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);
|