Reputation: 3637
I'm wondering - why do I need an AlarmManager.cancel() method, if I can just call cancel() method of corresponding PendingIntent
and it would also work?
Upvotes: 0
Views: 38
Reputation: 719
That's because the alarm and the pending intent are different things. Your alarm just triggers your pending intent at "x" time. If you cancel the pending intent but not your alarm then the alarm will be triggered anyway but the action will not occur because the pending intent is cancelled. Think of the alarm as the trigger and the pending intent as the action.
Upvotes: 1