gpt4 book ai didi

android - 当您收到来自 addProximityAlert 的响应时,您如何知道您收到的是哪个设置?

转载 作者:行者123 更新时间:2023-11-29 02:16:49 30 4
gpt4 key购买 nike

我通过 addProximityAlert 在系统中添加了很多兴趣点.当我收到警报时,我不知道发生了哪个设置。

唯一通过的 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);

最佳答案

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

关于android - 当您收到来自 addProximityAlert 的响应时,您如何知道您收到的是哪个设置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3127925/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com