Android examples for Intent:Alarm Intent
clean Up Alarm PendingIntent
//package com.java2s; import java.util.HashSet; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; public class Main { static Context ctx; public static HashSet<PendingIntent> set = new HashSet<PendingIntent>(); public static void cleanUp() { PendingIntent arr[] = new PendingIntent[set.size()]; AlarmManager am = (AlarmManager) ctx .getSystemService(Context.ALARM_SERVICE); arr = set.toArray(arr);/*from w ww .j av a 2 s. c om*/ for (int i = 0; i < arr.length; i++) { am.cancel(arr[i]); } } }