title: Incorrect extras received with all intents but the first one
body: <p>I have a small application which can be used to set reminders for future events. The app uses an AlarmManager to set the time for when the user should be reminded. When the alarm goes off, a BroadcastReceiver registers this and in turn starts a service to notify the user via a toast and a notification in the status bar.</p>
  
  <p>In order to display the correct information in the notification and toast, some extra information is passed along with the intent. The first time a reminder is registered, the info received by the BroadcastReceiver and passed on to the service is correct. But for each following reminder (i.e. each new intent received by the BroadcastReceiver) this information stays the same even when the information sent is different.</p>
  
  <p>As an example, if the string "foo" is put as an extra with the first intent, "foo" is correctly extracted by the BroadcastReceiver. If "bar" is put as an extra in the second intent, "foo" is still extracted by the BroadcastReceiver. </p>
  
  <p>This is the code that registers the alarm and passes the intent (main ui-class):</p>
  
  <pre><code>Intent intent = new Intent(ACTION_SET_ALARM);
  intent.putExtra("desc", desc);
  intent.putExtra("time", time);
  intent.putExtra("dbId", dbId);
  intent.putExtra("millis", millis);
  PendingIntent pIntent = PendingIntent.getBroadcast(quickAlert.this, 0, intent, 0);
  
  // Schedule the alarm!
  AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
  am.set(AlarmManager.RTC_WAKEUP, millis, pIntent);
  </code></pre>
  
  <p>The onReceive()-method in the BroadcastReceiver class:</p>
  
  <pre><code>@Override
  public void onReceive(Context context, Intent intent) {
  
      Intent i = new Intent(context, AlertService.class);
  
      String desc = intent.getStringExtra("desc").equals("") ? "": ": " + intent.getStringExtra("desc");
      String time = intent.getStringExtra("time");
      long dbId = intent.getLongExtra("dbId", -1);
      long millis = intent.getLongExtra("millis", -1);
  
      i.putExtra("desc", desc);
      i.putExtra("time", time);
      i.putExtra("dbId", dbId);
      i.putExtra("millis", millis);
      Log.d(TAG, "AlertReceiver: " + desc + ", " + time + ", " + dbId + ", " + millis);
  
      Toast.makeText(context, "Reminder: " + desc, Toast.LENGTH_LONG).show();
      context.startService(i);
  }
  </code></pre>
  
  <p>The intent-filter in the manifest:</p>
  
  <pre><code>&lt;receiver android:name=".AlertReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.aspartame.quickAlert.ACTION_SET_ALARM" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>I've been stuck with this for some time now, so help is very much appreciated!</p>