With listFiles()
I can get list of file in /data/data/package/files
.
How can I get list of files from directory like /data/data/package/myfolder
?
Thanks.
Your application has a "Files" and "Caches" directory. You can query this path with Context.getFilesDir() or Context.getCacheDir().
There is also a Context.getDir() function for private folders like "myfolder".
With the corrsponding File object, you can enumerate the files.
File dirFiles = mContext.getFilesDir();
for (String strFile : dirFiles.list())
{
// strFile is the file name
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With