Deva

Deva

  • NA
  • 55
  • 7.6k

When I try to get list of files inside a directory it just returns ima

Mar 31 2021 7:22 AM
Hi guys When I try to get list of files inside a directory it just returns image files and subdirectories...
 
File file = new File("/sdcard/Documents");
String[] list = file.list();
for (String s: list) {
     System.out.println(s);
}
 
output: p0.png p1.svg directory.
 
But directory contents are: p0.png , p1.svg , directory , c0.css, m0.mp4
 
What's the problem? 
 

Answers (4)