From 8899187ee46fb8f4a7de1d42ded54c41abbda1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Tue, 13 Jun 2023 00:11:40 +0100 Subject: [PATCH] Replace forEach with explicit for cycle forEach with lambda is only available in SDK24+ --- .../gadgetbridge/externalevents/gps/GBLocationManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);