title: PendingIntents keep caching same object
body: <p>i ve been facing some problems trying to pass data through intents and pending intents to a BroadcastReceiver, concerning proximity alerts. More specifically, am trying to pass an object, that among others holds the user's constantly changing position. I ve tried various tactics being proposed here (and not only) but none worked, resulting to either null values or same-as-first-time created intents, when the intent is retrieved on the BroadcastReceiver's side. Tactics used:</p>
  
  <ul>
  <li>Flagging the intent that carries the object with:FLAG_ACTIVITY_NEW_TASK+FLAG_ACTIVITY_CLEAR_TOP+FLAG_ACTIVITY_SINGLE_TOP
  Result:Null values on the BroadacastReceiver's side</li>
  <li>Flagging the pending intent created using the initial intent, with:FLAG_UPDATE_CURRENT or FLAG_CANCEL_CURRENT
  Result:Null values on the BroadacastReceiver's side</li>
  <li>Acquiring a random ID for intent or the pending intent using System.currentTimeMillis();
  Result:Intents are not fired or received at all</li>
  <li>Nothing described above. Result:Retrieving the same initial value every time.</li>
  </ul>
  
  <p>Code for the calling method (stripped from any experimentations/producing null values):</p>
  
  <pre><code>private void setProximityAlert(MyCar myCar) { 
    String locService = Context.LOCATION_SERVICE; 
    LocationManager locationManager; 
    locationManager = (LocationManager)getSystemService(locService);
    float radius = myCar.getMyCarRadius(); 
    long expiration = myCar.getMyCarExpiration(); 
    myService.setMyDriverLat(userLat);//setting user's position
    myService.setMyDriverLng(userLng);//setting user's position
    Intent  intent = new Intent(myCar.getMyCarName());
    intent.putExtra("myCar",myCar);
  
    PendingIntent proximityIntent = PendingIntent.getBroadcast(this, -1, intent, 0);
    locationManager.addProximityAlert(myCar.getMyCarLat(), myCar.getMyCarLng(), radius, expiration, proximityIntent);
   }
  </code></pre>
  
  <p>Code for the calling method that sets the intent filter and registers the BroadcastReceiver:</p>
  
  <pre><code>public void addNewCarPoint (MyCar myCar){
          IntentFilter filter = new IntentFilter(myCar.getMyCarName());
          registerReceiver(new ProximityAlertReceiver(), filter);
          setProximityAlert(myCar);
      }
  </code></pre>
  
  <p>Code for the BroadcastReceiver's side:</p>
  
  <pre><code>public class ProximityAlertReceiver extends BroadcastReceiver {
   @Override
   public void onReceive (Context context, Intent intent) {
   MyCar myCar=(MyCar)intent.getParcelableExtra("myCar");
    driverLoc=(String)Double.toString(myCar.getMyDriverLat());
    Toast.makeText(context, userLoc, Toast.LENGTH_SHORT).show();
    Intent i = new Intent(context, MyCarDiscoveryPrompt.class);
    context.startActivity(i);//firing intent
   }
   public void intentDataLoader(){      
   }
  </code></pre>
  
  <p>}</p>
  
  <p>Any ideas would be more than welcome.
  Thank you in advance.</p>