1
Because I am unable to locate my.txt file. Follow the code:
public void criatxt() {
String texto = "XXX";
try {
String filePath = this.getFilesDir().getPath().toString()
+ "/meuarquivo.txt";
File f = new File(filePath);
PrintWriter arq = new PrintWriter(f);
System.out.println("Salvou");
arq.print(texto);
arq.close();
} catch (Exception er) {
er.printStackTrace();
System.out.println("Salvou: " + er.getStackTrace());
}
}
Thank you in advance!
By recording in this folder you will not be able to see it yourself, this folder is only accessible by the application itself. Try writing to a public folder (Internal Storage) or to the memory card (Xternal Storage). Then I’ll draw up an answer, while you’re at it: http://stackoverflow.com/questions/31220476/android-write-to-internal-storage
– Piovezan
vlw man, I realized that this my code recorded on the date/date of Android and I ended up getting it from there anyway, but it is learning for when I do not have access to the date, when using the mobile as device. vlw!
– daniel12345smith