6

I've question with cancel() in AlarmManager

when I set alarm I use AlarmManger, this my code

        StringBuilder q = new StringBuilder()
        .append(time).append(".")
        .append(day);
        String action = q.toString();

        Intent AlarmIntent = new Intent(Edit_Contract.this, ReceiverContract.class);
        AlarmIntent.setAction(action);
        AlarmManager AlmMgr = (AlarmManager)getSystemService(ALARM_SERVICE);

        PendingIntent Sender = PendingIntent.getBroadcast(Edit_Contract.this, 0, AlarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);

and then,I want to cancel all alarm which I set,what should I do

user836807
  • 139
  • 2
  • 2
  • 5
  • Have you looked at AlarmManager.cancel(yourPendingIntent)? Thats the only thing I can see looking at the docs. – Delete Aug 29 '11 at 17:44

1 Answers1

4

Are you sure you sure you did the research on the nose? Here's what i found during 2 minutes of looking: Android: Get all PendingIntents set with AlarmManager

Community
  • 1
  • 1
Moyshe
  • 1,122
  • 1
  • 11
  • 19
  • 2
    sorry,for my question was not clear,This research can cancel alarm one by one,but my question want to cancel all of alam which set not one by one – user836807 Aug 30 '11 at 06:49
  • 1
    @Moyshe: this almost makes me cry... Why does Android allways lacks simple cancelAll function (also for Nearby Devices) This ruïns my planning all the time. – Roel May 18 '16 at 13:06