I am not sure if I asked the question 100% right but here it goes:
I got this code:
File root = Environment.getExternalStorageDirectory();
File saveFolder= new File(Root, "Save");
String[] files=saveFolder.list(
new FilenameFilter() {
public boolean accept(File dir, String name) {
//define here you filter condition for every single file
return name.startsWith("1_");
}
});
if(files.length>0) {
System.out.println("FOUND!");
System.out.println("Files length = "+files.length);
} else {
System.out.println("NOT FOUND!");
}
I got 2 files that start with "1_", the println also shows I got 2 files.
But how can I print or see, the file names, of those 2 files, after the boolean?
So something like (between the other System.out.println):
System.out.println("File names = "+files.names);
Loop over the array:
Note that the naming convention of variables is to start them with lower case.