mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-07 23:03:11 +08:00
Make sure we load the correct resource id for plugins.xml.
This commit is contained in:
parent
66f7afbed2
commit
6c65a6a016
@ -49,7 +49,8 @@ public final class PluginManager {
|
|||||||
* Load plugins from res/xml/plugins.xml
|
* Load plugins from res/xml/plugins.xml
|
||||||
*/
|
*/
|
||||||
public void loadPlugins() {
|
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;
|
int eventType = -1;
|
||||||
while (eventType != XmlResourceParser.END_DOCUMENT) {
|
while (eventType != XmlResourceParser.END_DOCUMENT) {
|
||||||
if (eventType == XmlResourceParser.START_TAG) {
|
if (eventType == XmlResourceParser.START_TAG) {
|
||||||
@ -57,7 +58,7 @@ public final class PluginManager {
|
|||||||
if (strNode.equals("plugin")) {
|
if (strNode.equals("plugin")) {
|
||||||
String name = xml.getAttributeValue(null, "name");
|
String name = xml.getAttributeValue(null, "name");
|
||||||
String value = xml.getAttributeValue(null, "value");
|
String value = xml.getAttributeValue(null, "value");
|
||||||
System.out.println("Plugin: "+name+" => "+value);
|
//System.out.println("Plugin: "+name+" => "+value);
|
||||||
this.addService(name, value);
|
this.addService(name, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user