
在Android中更新地理围栏的最佳方法是什么?是先删除旧的Geofences集合,然后像这样添加新更新的列表:
LocationServices.GeofencingAPI.removeGeofences( mGoogleapiclient, getGeofencePendingIntent() ).setResultCallback(this); LocationServices.GeofencingAPI.addGeofences( mGoogleapiclient, getGeofencingRequest(), getGeofencePendingIntent() ).setResultCallback(this); // Result processed in onResult().或者我可以直接调用addGeofences而不删除旧的,并让新的替换旧的?
解决方法:
如果您首先阅读本手册,您会注意到addGeofences说:
总结If an existing geofence with the same request ID is already registered, the old geofence is replaced by the new one, and the new PendingIntent is used to generate intents for alerts.
以上是内存溢出为你收集整理的Android Update Geofences全部内容,希望文章能够帮你解决Android Update Geofences所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)