I\'m able to do this:
File images = new File(path);
File[] imageList = images.listFiles(new FilenameFilter(){
public boolean accept(File
For sort based on file name,Add
object1.getName().toLowerCase(Locale.getDefault())
instead of
object1.getName()
to avoid sort issues causing by Locale changes and upper/low case filenames
final File[] sortedFileName = images.listFiles();
if (sortedFileName != null && sortedFileName.length > 1) {
Arrays.sort(sortedFileName, new Comparator() {
@Override
public int compare(File object1, File object2) {
return object1.getName().toLowerCase(Locale.getDefault()).compareTo(object2.getName().toLowerCase(Locale.getDefault()));
}
});
}