我正在尝试打开一个 xml 文件来解析它,但我已经停止尝试打开该文件。我的代码是:
try {
return new FileInputStream(location);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
其中 location 是传递给函数的字符串。运行我的代码后,我得到:
java.io.FileNotFoundException: /C:/Users/Seth/AndroidWorkspace/UCoupon/res/xml/information.xml (没有这样的文件或目录)
我给出了完整的文件路径,我没有拼错任何东西。我究竟做错了什么?