rubberdont rubberdont -4 years ago 126
Android Question

How to count the number of files in a folder in external storage?

I wanted to know the count of my downloaded files in a folder saved in my external strorage

Answer Source

Try this,and replace yourfolder with your actual folder name

File dir = new File(Environment.getExternalStorageDirectory() + "/yourfolder");
File[] files = dir.listFiles();
int numberOfFiles = files.length;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download