if (folder.listFiles() != null) {
for (File file : folder.listFiles()) {
if (file.isFile()) {
Log.v("vvv", "file with name " + folder.getName() + " in path " + folder.getAbsolutePath());
}
}
}
This prints something like this
/vvv ( 3940): Folder with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): file with name .thumbnails in path /sdcard/DCIM/.thumbnails
V/vvv ( 3940): Folder with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
V/vvv ( 3940): file with name Camera in path /sdcard/DCIM/Camera
I do some idiotic thing in the code, but I do not know what…
I want to list all the folders and all the files from the sdcard…
can you help me found my bug, Thanks
You probably meant
file.getName().