I'm having a problem with alarmManager
and the pending intent with extras that will go along with it.
If I set multiple alarms, they will go off, however the extras stay the same.
I have already read into these questions:
- android pending intent notification problem
- Android keeps caching my intents Extras, how to declare a pending intent that keeps fresh extras?
and I have tried:
- assigning a unique ID to each pending intent and
- using all the pending intent flags,
all to no avail. I have no clue why it will not work.
Here is a code snippet:
Intent intent = new Intent(con,
AppointmentNotificationReciever.class);
intent.putExtra("foo", bar.toString());
int id = randomNum;
PendingIntent sender = PendingIntent.getBroadcast(con, id,
intent, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager am = (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.RTC_WAKEUP, scheduleExecution, sender);