【发布时间】:2015-12-10 10:53:31
【问题描述】:
我知道的简单问题 - 但我的 android 应用程序根本找不到我的 CSV 文件。我把文件放在这里:
并使用以下代码访问它:
public void getFragenfromCSV(){
AssetManager a = getAssets();
BufferedReader reader = null;
try {
InputStream is = a.open("fragenbronze.csv");
reader = new BufferedReader(new InputStreamReader(s));
} catch (IOException e) {
System.out.println("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS");
e.printStackTrace();
}
try {
String line;
while ((line = reader.readLine()) != null) {
String[] RowData = line.split(",");
System.out.println(RowData[0]);
}
}
catch (IOException ex) {
// handle exception
}
}
在运行应用程序时,我总是从 catch 部分得到 IOException。
【问题讨论】: