Here you can find the source of unsetAlarm(Context context, PendingIntent pendingIntent)
public static void unsetAlarm(Context context, PendingIntent pendingIntent)
//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);/*from www . j av a 2 s. c o m*/ am.cancel(sender); } public static void unsetAlarm(Context context, PendingIntent pendingIntent) { AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.cancel(pendingIntent); } }