title: How can I correctly pass unique extras to a pending intent?
body: <p>I'm having a problem with <code>alarmManager</code> and the pending intent with extras that will go along with it.</p>
  
  <p>If I set multiple alarms, they will go off, however the extras stay the same.  </p>
  
  <p>I have already read into these questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3009059/">android pending intent notification problem</a></li>
  <li><a href="https://stackoverflow.com/questions/3140072/">Android keeps caching my intents Extras, how to declare a pending intent that keeps fresh extras?</a></li>
  </ul>
  
  <p>and I have tried:</p>
  
  <ul>
  <li>assigning a unique ID to each pending intent and </li>
  <li>using all the pending intent flags,</li>
  </ul>
  
  <p>all to no avail.  I have no clue why it will not work.</p>
  
  <p>Here is a code snippet:</p>
  
  <pre><code>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);
  </code></pre>