In my main activity, I have a method setRepeatingAlarm() to set the Alarms when the app first loads. That method successfully sets the Alarms by looping through a column and taking an integer value from each row in a SQLite table. Here is the method in basic:

After the Method is completed it then loops through the rows each again and puts each into a CustomAdapter (List) to display the data. Here is the context (again, in basic) in my onCreate in the main class:

I want the user to either long press a row and it will delete the item, or there is a button to delete all rows. Everything works, but I can not get the alarms to go away.

I understand HOW to do this (cancel method by setting same pendingIntent with the same extras), but my attempts have been foiled! and I dont know WHERE to put it? Everything above is in the same class.

Whether the user deletes one row or all, I think the easy way is to delete all Alarms and loop through that method again to reset them. Can anyone help out and tell me where to put this canceling code?