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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With