I am writing an application in which user can configure alerts/alarms. At this point, I have everything working expect the one. I am firing off an alarm using
As it was answered here: there is no supported API to this.
Official documentation says that
If a time of day is specified, and EXTRA_SKIP_UI is true, and the alarm is not repeating, the implementation should remove this alarm after it has been dismissed.
But different manufactures implement their own alarm clocks and I'm not sure if someone supporrts this. I have tried it on JB emulator and looks like it dosen't work. Maybe, on KitKat? Only this one is ok on JB:
If an identical alarm exists matching all parameters, the implementation may re-use it instead of creating a new one
So, maybe, better solution is to use youre own alarm, created with AlarmManager or warn user that he has to remove Alarms by hands (to make it more obvious - not use AlarmClock.EXTRA_SKIP_UI).
call method cancel(...) from AlarmManager, using the same PendingIntent you used to set the alarm. Example:
mAlarmPendingIntent = PendingIntent.getActivity(this, requestCode, intent, flags);
this.getAlarmManager().cancel(mAlarmPendingIntent);
this refers to the Activity or the Service from which you are cancelling the alarm