2

我通过addProximityAlert向系统添加了很多 POI 。当我收到警报时,我不知道发生了哪个设置。

唯一通过的 Extra 是文档中描述的“进入”标志。

我怎么知道?

这里的答案是工作代码:

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);
4

1 回答 1

1

Intent例如,在您的 s 上使用您包装在s 中的自定义操作字符串PendingIntent,以便您可以区分不同的操作字符串。

于 2010-06-27T17:59:41.723 回答