I guess you want to show the names of the files from that directory so you could try this:
File dir = new File(dirPath);
File[] filelist = dir.listFiles();
String[] theNamesOfFiles = new String[filelist.length];
for (int i = 0; i < theNamesOfFiles.length; i++) {
theNamesOfFiles[i] = filelist[i].getName();
}
The adapter to use with the list :
new ArrayAdapter<String>(this, android.R.layout.simple_list_item, theNamesOfFiles);
For anything more complicated than showing the names of the files you have to implement a custom adapter.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…