diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/gps/GBLocationManager.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/gps/GBLocationManager.java index f92ee6878..16f3a17de 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/gps/GBLocationManager.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/gps/GBLocationManager.java @@ -105,7 +105,9 @@ public class GBLocationManager { stopProvider(context, providerMap.get(providerType)); toBeRemoved.add(providerType); } - toBeRemoved.forEach(c->{providerMap.remove(c);}); + for (final LocationProviderType providerType : toBeRemoved) { + providerMap.remove(providerType); + } } else { stopProvider(context, providerMap.get(gpsType)); providerMap.remove(gpsType);