use Iterator
MODIFY
src/android/plugin/google/maps/CordovaGoogleMaps.java
src/android/plugin/google/maps/CordovaGoogleMaps.java
@@ -40,7 +40,6 @@ import org.json.JSONObject;
import java.lang.reflect.Field;
import java.util.Collection;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Set;
@@ -525,14 +524,12 @@ public class CordovaGoogleMaps extends CordovaPlugin implements ViewTreeObserver
@Override
public void onResume(boolean multitasking) {
Collection<PluginEntry>pluginEntries = pluginManager.getPluginEntries();
- ArrayList<PluginEntry>pluginsToResume = new ArrayList<PluginEntry>();
- for (PluginEntry pluginEntry: pluginEntries) {
+ for (Iterator<PluginEntry> iterator = pluginEntries.iterator(); iterator.hasNext();) {
+ PluginEntry pluginEntry = iterator.next();
if (pluginEntry.service.startsWith("map_")) {
- pluginsToResume.add(pluginEntry);
+ pluginEntry.plugin.onResume(multitasking);
}
}
-
- pluginsToResume.forEach(p -> p.plugin.onResume(multitasking));
}
@Override

use Iterator