private void readRandomContacts() throws IOException
{
BufferedReader bufRdr;
contacts = new ArrayList<Contacts>();
File randomContactsFile = new File("C:\randomContacts.csv");
try {
bufRdr = new BufferedReader(new FileReader(randomContactsFile));
String line = null;
String[] a = new String[2];
while ((line = bufRdr.readLine()) != null)
{
a = line.split(",");
Contacts c = new Contacts(a[0], a[1], a[1], a[1], a[2]);
contacts.add(c);
}
} catch (FileNotFoundException e) {
Log.d("file not found", "check");
e.printStackTrace();
}
我似乎無法找到該文件,並且randomContacts.csv確實存在於C目錄中。請幫忙嗎?找不到文件
是它拋出一個異常? – smp7d
是一個filenotfound異常! :/ – michelle