Skip to content Skip to sidebar Skip to footer

How To Cancel Specific Alarm In Android

In my app, the user can set multiple alarms for the same movie e.g 'On release date', 'A week before release', 'A month before release' and now I'm stuck on cancelling a specific a

Solution 1:

do I concatenate both together and pass it as the id to my pending intent?

It seems logical.

Also you can use below way to know if your PendingIntent exists.

PendingIntentalarmIntent= PendingIntent.getBroadcast(context, requestCode,
          intent, PendingIntent.FLAG_NO_CREATE);
if (broadcast != null) {
    alarmManager.cancel(alarmIntent );
}

Post a Comment for "How To Cancel Specific Alarm In Android"