From bfef72a7c44272562fc305fec9b94972b0e2595f Mon Sep 17 00:00:00 2001 From: Bryce Curtis Date: Tue, 15 Nov 2011 14:29:32 -0600 Subject: [PATCH] Add onload attribute to plugin in plugins.xml to create the plugin at load time instead of lazy loading. --- framework/src/com/phonegap/api/PluginManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/src/com/phonegap/api/PluginManager.java b/framework/src/com/phonegap/api/PluginManager.java index 14e24493..db10d637 100755 --- a/framework/src/com/phonegap/api/PluginManager.java +++ b/framework/src/com/phonegap/api/PluginManager.java @@ -90,6 +90,11 @@ public final class PluginManager { pluginName = xml.getAttributeValue(null, "name"); //System.out.println("Plugin: "+name+" => "+value); this.addService(pluginName, pluginClass); + + // Create plugin at load time if attribute "onload" + if ("true".equals(xml.getAttributeValue(null, "onload"))) { + this.getPlugin(pluginName); + } } else if (strNode.equals("url-filter")) { this.urlMap.put(xml.getAttributeValue(null, "value"), pluginName); }