I set the alarm by pressing a button.
An alarm is triggered with intent.
This intent gets an extra "int" to transmit to the broadcast receiver.
The problem is that the intention is additionally set once on the first click of a button and never changes on other clicks:
Intent intent = new Intent(A.this, B.class);
intent.putExtra(WAKEUP_DURATION, wakeUpDuration);
PendingIntent sender = PendingIntent.getBroadcast(A.this, 0, intent, 0);
I tried removing it in the broadcast receiver, but with no luck:
intent.removeExtra(A.WAKEUP_DURATION);
source
share