I receive this error in the title. I create 2 arraylists from edit text fields and save them in an xls file.
To save:
File sdCard = Environment.getExternalStorageDirectory();
File directory = new File (sdCard, "MyFiles");
directory.mkdirs();
File file = new File(directory, filename);
FileOutputStream fos;
try {
fos = new FileOutputStream(file);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fos));
bw.write(mydata+"\t"+myweight+"\n");
bw.flush();
bw.close();
} catch (IOException e2) {
e2.printStackTrace();
}//catch
and to load :
File sdCard = Environment.getExternalStorageDirectory();
File directory = new File (sdCard, "MyFiles");
File file = new File(directory, filename);
String s;
FileInputStream fis;
try {
fis = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
do {
s = br.readLine();
if (s != null)
{
data.add(Double.parseDouble(s));
weight.add(Double.parseDouble(s));
}
} while (s != null);
} catch (IOException e) {
e.printStackTrace();
}
}
It shows the number format exception in line "data.add(Double.parseDouble(s));".
Also, I enter for example in the 2 fields 1,10 and 2,20 and the file contains a cell which has [1.0, 2.0] [1.0, 2.0]
The other data?And how to put the data in 2 columns?