Here you can find the source of cancelAlarm(PendingIntent intent, Context context)
public static void cancelAlarm(PendingIntent intent, Context context)
//package com.java2s; //License from project: Open Source License import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; public class Main { public static void cancelAlarm(PendingIntent intent, Context context) { AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.cancel(intent);/* ww w . ja va 2 s. c o m*/ } }