I am adding an event to my schedule list and alarm has been fixed to that event. I have to repeat alarm for every one minute, from the before five minutes of event ending time. In below conditions I have to remove or cancel alarm for particular event.
I am following concepts like sqlite database, Alarm manger, Services. I am confusing little bit using Services and pendingIntent. So, please suggest me the right way to approach my requirement.
You need to use the method cancel(...) from AlarmManager, using the same PendingIntent you used to set the alarm. Example:
this.getAlarmManager().cancel(mAlarmPendingIntent);
(this refers to the Activity or the Service from which you are cancelling the alarm).
Here is the link for the API.
Create the PendingIntent as:
mAlarmPendingIntent = PendingIntent.getActivity(this, requestCode, intent, flags);
The API doc for PendingIntent is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With