Alarm Editing!

I set an alarm for my reminder:

PendingIntent sender = PendingIntent.getBroadcast(AddToDoList.this, 
          Integer.parseInt(DBHelperClass.getMaxPrimaryId()), intent, 0);

I use a unique value (primary identifier) ​​to set the alarm. When I want to edit the alarm, I use the same key. But what I see is that both anxieties go away! original as well as edited.

How do I cancel an old alarm? Also, these alarms do not work after I switched and then switched back to my device.

+3
source share
2 answers

How do I cancel an old alarm?

Call cancel()using the original PendingIntent.

Also these alarms do not work once I switchOff, and then switch back to my device.

. , , BroadcastReceiver, .

+1

, Intents - requestCode . Intent , .

, , , , RTC_WAKEUP , .

0

Source: https://habr.com/ru/post/1752762/


All Articles