can't find file created in dir returned by getFilesDir()

4.5k Views Asked by At

One part of my app needs to write a data file out. I use getFilesDir() and it gives me a path like this (after adding a file name):

 /data/data/com.casadelgato.zillaconfigdroid/files/Log.1378357559316.csv

I create a PrintWriter to the file, write a bunch of stuff to it, and close it. No errors.

The problem is that I can't find the file anywhere on my Android device.

1

There are 1 best solutions below

0
On

mention the file name in the path

FileOutputStream fos = context.openFileOutput(path,
                    Context.MODE_PRIVATE);

write the file into the stream...and you get the file by passing the same file name

FileInputStream openFileInput = context.openFileInput(path);

read the input stream