From http://android-er.blogspot.com/2013/08/list-files-in-directory-with-specified.html
private File[] getJpgFiles(File f){ File[] files = f.listFiles(new FilenameFilter(){ @Override public boolean accept(File dir, String filename) { return filename.toLowerCase().endsWith(".jpg"); }}); return files; }