I am using LocationClient with PendingIntent to get location updates.
PendingIntent.getService(context, 0, new Intent(context, OnLocationAvail.class), PendingIntent.FLAG_UPDATE_CURRENT)
The Above code works fine I get the location from the key LocationClient.KEY_LOCATION_CHANGED
But when I have an extras of parcelable data as described below, the service gets called with the parcelable data but the key LocationClient.KEY_LOCATION_CHANGED in the intent extras is always null.
Intent callbackIntent = new Intent(context, OnLocationAvail.class);
callbackIntent.putExtra(SOME_KEY, PARCELABLE_DATA);
PendingIntent.getService(context, 0, callbackIntent, PendingIntent.FLAG_UPDATE_CURRENT);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…