Esta pregunta de alguna manera se relaciona con la pregunta cuando estaba buscando get the extras back in startActivityForResult pero ahora me enfrento a otro desafío.¿Por qué PendingIntent no devuelve la configuración de Extras personalizada para Intent?
Me he suscrito para recibir ProximityAlerts y he creado explícitamente la intención de incluir algunos extras. Pero cuando recibí el servicio, los extras no están allí.
Después de las respuestas aquí es el código de trabajo:
Intent intent = new Intent(this, PlacesProximityHandlerService.class);
intent.setAction("PlacesProximityHandlerService");
intent.putExtra("lat", objPlace.getLat());
intent.putExtra("lon", objPlace.getLon());
intent.putExtra("error_m", objPlace.getError()+ALERT_RANGE_IN_METERS);
PendingIntent sender=PendingIntent.getService(this, 0, intent, 0);
LocationUtils.addProximity(this, objPlace.getLat(), objPlace.getLon(),objPlace.getError()+ALERT_RANGE_IN_METERS, -1, sender);
La documentación dice parámetro PendingIntent to be sent for each location update
intenté esto y no funcionó. Primero configuré una acción sobre mi intención y luego sobre los extras y luego, creé un intento pendiente que dispara a un receptor de difusión que dispara esto usando un administrador de alarma – jonney