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 (ID は文字列) のリストを受け入れるためであり、明らかに文字列は「これは実際に機能しますか?」です。geofenceId ではありません。

では、なぜこの予期しない結果が得られるのか、誰かが知っていますか? これは Geofence API のバグですか?

4

0 に答える 0