0
My question is regarding how I create files and folders that can be viewed and accessed on later computers. In my code in the project I have a method that creates a text file.
public void criaArquivo() {
File file = new File (Envoiment.getExternalStoragePublicDirectory("/") + "/testes/TextoFiles.txt");
FileOutputStream outputStream;
try {
outputStream = new FileOutputStream (file);
outputStream.write("string".getBytes());
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
Well, so far so good it creates a file . txt there on
/Storage/Emulated/0/testes/Textofile.txt
I check this using my Android file managers. It happens that when I open the PC via USB, enabling the MTP appears all the other folders that have in this directory, the
/Storage/Emulated/0/
minus what I just created. Why?
No error occurred in writing the file?
– Wakim
I can open it by the file manager of my phone. I open it in HTML Reader that Android suggests open with
– Lucas Batista