Make sure your AndroidManifest.xml has the appropriate permission:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
The next problem may be your file name. I use the following in one of my applications and it works (note the trailing slash and the lack of a leading slash):
directory = new File(Environment.getExternalStorageDirectory(), "Subdirectory/") final File[] files = directory.listFiles();
The next problem may be that the Environment.getExternalStorageDirectory() path gives you. Newer devices have a section on internal storage that emulates an SD card, and Environment.getExternalStorageDirectory() can return this, not a real SD card.
source share