In my application I want to display all folders on an SD card in a listview and need functionality such that if a user clicks on a folder it will show its sub-directories.
Asked
Active
Viewed 8,904 times
1 Answers
11
File f = new File(path);
File[] files = f.listFiles();
for (File inFile : files) {
if (inFile.isDirectory()) {
// is directory
}
}
This will return you the list of folders in your path. From here: https://stackoverflow.com/a/6997422/2065418