Android examples for Android OS:Alarm Set Up
cancel Alarm using Intent
//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 cancelAlarm(Context context, int index, String action) { Intent intent = new Intent(action); intent.putExtra("index", index); PendingIntent sender = PendingIntent.getBroadcast(context, index, intent, 0);// w w w . j a v a 2 s . c o m AlarmManager am = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); am.cancel(sender); } }