Java tutorial
//package com.java2s; //License from project: Open Source License 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) { PendingIntent p = PendingIntent.getBroadcast(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); alarm.cancel(p); Log.d("petsitter-alarm", "Alarme cancelado."); } }