I add to system a lot of POIs via addProximityAlert. When I have got the alert, I don't know for which setting has occurred.
The only Extra that is passes is the 'entering' flag as it is described in the documentation.
How can I know that?
After the answers here is the working code:
Intent intent = new开发者_如何学Python 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);
Use a custom action string on your Intent
s that you wrap in the PendingIntent
s, so you can tell the different ones apart, for example.
精彩评论