Yeap, geofences will be removed once location is switched off.
You should listen for location provider broadcasts using a BroadcastReceiver
in your manifest, something like:
and then register your geofences again.
public class LocationProviderReceiver extends BroadcastReceiver {
public LocationProviderReceiver() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (action.equals(LocationManager.PROVIDERS_CHANGED_ACTION)) {
// if location services enabled
// restart geofences
}
}
}