Share via


GeofenceHardware.RemoveGeofence(Int32, GeofenceMonitoringType) Method

Definition

Removes a geofence added by #addGeofence call.

[Android.Runtime.Register("removeGeofence", "(II)Z", "")]
public bool RemoveGeofence (int geofenceId, Android.Hardware.Location.GeofenceMonitoringType monitoringType);
[<Android.Runtime.Register("removeGeofence", "(II)Z", "")>]
member this.RemoveGeofence : int * Android.Hardware.Location.GeofenceMonitoringType -> bool

Parameters

geofenceId
Int32

The id of the geofence.

monitoringType
GeofenceMonitoringType

The type of the hardware subsystem that should be used to monitor the geofence.

Returns

true when the geofence is successfully sent to the hardware for removal. .

Attributes

Remarks

Removes a geofence added by #addGeofence call.

If this call returns true, it means that the geofence has been sent to the hardware. GeofenceHardwareCallback#onGeofenceRemove will be called with the result of the remove call from the hardware.

Requires android.Manifest.permission#ACCESS_FINE_LOCATION permission when #MONITORING_TYPE_GPS_HARDWARE is used.

Requires android.Manifest.permission#LOCATION_HARDWARE permission to access geofencing in hardware.

This API should not be called directly by the app developers. A higher level api which abstracts the hardware should be used instead. All the checks are done by the higher level public API. Any needed locking should be handled by the higher level API.

Java documentation for android.hardware.location.GeofenceHardware.removeGeofence(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to