At the moment I use this to create an array of directories and files in the directory /mnt/sdcard.
This sorts the filelist开发者_Python百科 in alphabetical order, but case sensitive.
I would like to have this case insensitive.
File f = new File("/mnt/sdcard/");
File[] files = f.listFiles();
Arrays.sort(files);
You can use File.isFile() to check which things are files. See: http://download.oracle.com/javase/1.4.2/docs/api/java/io/File.html
You can use the Arrays.sort() where you pass in a Comparator to make the comparison case insensitive. see: Arrays Documentation
You'll want to first split the array into 2 arrays, 1 for directories and 1 for files. Then do the sort on each array.
精彩评论