1

奇怪的是,如果我运行以下代码,我会在回调中得到一个SUCCESSstatusCode 。onRemoveGeofencesByRequestIdsResut()

ArrayList<String> geofencesToRemove = new ArrayList<String>();
                        geofencesToRemove.add("does this actually work?");
                        MainActivity.
                                mLocationClient.
                                removeGeofences(geofencesToRemove, new LocationClient.OnRemoveGeofencesResultListener() {
                                    @Override
                                    public void onRemoveGeofencesByRequestIdsResult(int statusCode, String[] strings) {
                                        if (statusCode == LocationStatusCodes.GEOFENCE_NOT_AVAILABLE) {
                                            Log.i("geofence info", "geofence not available to remove");
                                        } else if (statusCode == LocationStatusCodes.ERROR){
                                            Log.i("geofence info", "error. geofence not removed");
                                        } else if (statusCode == LocationStatusCodes.SUCCESS){
                                            Log.i("geofence info", "geofence successfully removed");
                                        }

                                    }

                                    @Override
                                    public void onRemoveGeofencesByPendingIntentResult(int i, PendingIntent pendingIntent) {

                                    }
                                });

我不应该得到SUCCESSstatusCode 的原因是它removeGeofences()接受一个 geofenceIds 列表(Ids 是字符串),并且显然字符串“这真的有效吗?” 不是地理围栏ID。

那么,有谁知道为什么我会得到这个意想不到的结果?这是地理围栏 API 的错误吗?

4

0 回答 0