唉,提问半天没人知道,自己研究的,
File file = new File("/mnt/sdcard/menuimage"); if(file !=null){ File[] files = file.listFiles();//列出所有文件// File file;for(int i=0;i<files.length;i++){file = files[i];} for (File f : files) { if(isImageFile(f.getPath())){ imagePaths.add(f.getPath()); } } Collections.sort(imagePaths,String.CASE_INSENSITIVE_ORDER); //排序 }