public static String getVersion(){
String version = "";
InputStream input = MyUtils.class.getClassLoader().getResourceAsStream("version.xml");
try {
HashMap<String,String> data = parseXml(input);
version = data.get("version");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Log.e("dxsversion","version-->"+version);
return version;
}
此代码在Eclipse中正常工作,但在Android工作室无法正常工作 函数写在项目库(Android studio的库模块),version.xml文件在项目(Android studio的主模块),为什么?