有人知道在创建File []方面文件功能是否有限制 我试图将所有文件放在一个文件夹(大约3000个文件)中,放入文件[]。
但是当我在断点检查File []时它只显示100。
有没有办法将它设置得更高?
public ArrayList<Signs> getArrayOfSignsFromFolder(String imagePath, String videoPath2, String illustrativePath) {
ArrayList<Signs> arrayOfSigns = new ArrayList<Signs>();
Signs sign;
File directoryPhoto = new File(imagePath);
File[] photoListing = directoryPhoto.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if (name.toLowerCase().endsWith(".jpg")) {
return name.toLowerCase().endsWith(".jpg");
} else {
return false;
}
}
});
File directoryVideo = new File(videoPath2);
File[] videoListing = directoryVideo.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if (name.toLowerCase().endsWith(".mp4")) {
return name.toLowerCase().endsWith(".mp4");
} else {
return false;
}
}
});
File directoryIllu = new File(illustrativePath);
File[] illuListing = directoryIllu.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if (name.toLowerCase().endsWith(".jpg")) {
return name.toLowerCase().endsWith(".jpg");
} else {
return false;
}
}
});
if (illuListing != null) {
for (int i = 0; i < illuListing.length; i++) {
String illupath = illuListing[i].toString();
String illuName = illuListing[i].getName();
int removeIlluExtension = illuName.lastIndexOf(".");
if (removeIlluExtension > 0) {
illuName = illuName.substring(0, removeIlluExtension);
}
for (int j = 0; j < photoListing.length; j++) {
String photoPath = photoListing[j].toString();
String photoName = photoListing[j].getName();
int removePhotoExtension = photoName.lastIndexOf(".");
if (removePhotoExtension > 0) {
photoName = photoName.substring(0, removePhotoExtension);
}
if (illuName.equals(photoName)) {
for (int k = 0; k < videoListing.length; k++) {
String videoPath = videoListing[k].toString();
String videoName = videoListing[k].getName();
int removeVideoExtension = videoName.lastIndexOf(".");
if (removeVideoExtension > 0) {
videoName = videoName.substring(0, removeVideoExtension);
}
if (videoName.equals(photoName)) {
sign = new Signs(videoName, photoPath, videoPath, illupath);
arrayOfSigns.add(sign);
}
}
}
}
}
}
return arrayOfSigns;
}}
illuList文件夹包含:3086个文件 photoList文件夹包含:1366个文件 videoList文件夹包含:386个文件。
此函数应返回386项(每个文件夹中的文件名名称相同,以便匹配,所有视频文件都有匹配的照片文件和illufiles);
我几乎没有抓住listView上的a *****文件名。共返回28项