cancel Alarm - Android android.app

Android examples for android.app:AlarmManager

Description

cancel Alarm

Demo Code

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class Main {

  public static void cancel(Context context, Intent intent) {
    AlarmManager alarme = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    PendingIntent p = PendingIntent.getBroadcast(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);
    alarme.cancel(p);//ww  w .j  a  va 2s  .  c  o m
  }

}

Related Tutorials