Skip to content

Commit

Permalink
Make sure we load the correct resource id for plugins.xml.
Browse files Browse the repository at this point in the history
  • Loading branch information
brycecurtis committed Jul 12, 2011
1 parent 66f7afb commit 6c65a6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/src/com/phonegap/api/PluginManager.java
Expand Up @@ -49,15 +49,16 @@ public PluginManager(WebView app, PhonegapActivity ctx) {
* Load plugins from res/xml/plugins.xml
*/
public void loadPlugins() {
XmlResourceParser xml = ctx.getResources().getXml(com.phonegap.R.xml.plugins);
int id = ctx.getResources().getIdentifier("plugins", "xml", ctx.getPackageName());
XmlResourceParser xml = ctx.getResources().getXml(id);
int eventType = -1;
while (eventType != XmlResourceParser.END_DOCUMENT) {
if (eventType == XmlResourceParser.START_TAG) {
String strNode = xml.getName();
if (strNode.equals("plugin")) {
String name = xml.getAttributeValue(null, "name");
String value = xml.getAttributeValue(null, "value");
System.out.println("Plugin: "+name+" => "+value);
//System.out.println("Plugin: "+name+" => "+value);
this.addService(name, value);
}
}
Expand Down

0 comments on commit 6c65a6a

Please sign in to comment.