I am try to get all files from download folder with this code
The code give me mistake!
What is the problem with this code?
Is there any way to get the files?
This is my code
ArrayList<File> mFiles = new ArrayList<File>();
File mDirectory;
String folderPath = "/mnt/sdcard/download";
mDirectory = new File(folderPath);
ExtensionFilenameFilter filter = new ExtensionFilenameFilter();
// Get the files in the directory
File[] files = mDirectory.listFiles(filter);
if (files != null && files.length > 0) {
for (File f : files) {
mFiles.add(f);
}
Collections.sort(mFiles, new FileComparator());
}
Is this need support libs?