I can read in my log what i wrote in a txt file in my sdcard but i can't open the file. I need onClick open with a txt viewer or something else the file.. I can display in the log the values right now in this way:
public void onClick(View v)
{
File file = new File("/sdcard/ReportData.txt");
StringBuffer contents = new StringBuffer();
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
String text = null;
// repeat until all lines is read
while ((text = reader.readLine()) != null) {
contents.append(text)
.append(System.getProperty(
"line.separator"));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
Log.e("TEXT", contents.toString());
}
But i can't open the file.. how can i do it?