/// <summary> /// Activity Life cycle method /// /// Refreshs the activity information and permissions. /// </summary> protected override void OnResume() { base.OnResume(); if (verifyLocationPermissions()) { if (!areLocationServiceDependenciesOk()) { showEnableGpsDialog(); } else { if (locationServiceController == null) { locationServiceController = new LocationServiceControllerDroid(); locationServiceController.registerAndStart(); } if (geofencingServiceController == null) { geofencingServiceController = new GeofencingServiceControllerDroid(); geofencingServiceController.registerAndStart(); } } } else { if (locationServiceController != null && geofencingServiceController != null) { finishGeofencingService(); } } }
private void finishGeofencingService() { GeofencingServiceControllerDroid.stopService(); geofencingServiceController = null; }