Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CHLibrarian/cbc74600d574b9d41cf6 to your computer and use it in GitHub Desktop.
Save CHLibrarian/cbc74600d574b9d41cf6 to your computer and use it in GitHub Desktop.
ContextHub Element Services Geofence Delete (Android)
final long id = 1000;
GeofenceProxy proxy = new GeofenceProxy();
proxy.deleteGeofence(id, new Callback<Object>() {
@Override
public void onSuccess(Object result) {
// If you do not have push properly set up, you need to explicitly call synchronize on LocationService so it will stop generating events for this geofence
LocationService.getInstance().synchronize();
Log.d(TAG, String.format("Successfully deleted geofence id %s", id));
}
@Override
public void onFailure(Exception e) {
Log.d(TAG, e.getMessage());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment