Here you can find the source of getFiles(Context context, String ext)
public static List<File> getFiles(Context context, String ext)
//package com.java2s; import java.io.File; import java.util.ArrayList; import java.util.List; import android.content.Context; public class Main { public static List<File> getFiles(Context context, String ext) { File dir = context.getFilesDir(); final List<File> files = new ArrayList<File>(); File[] subFiles = dir.listFiles(); if (subFiles != null) { for (File file : subFiles) { if (file.isFile() && file.getName().endsWith(ext)) { files.add(file);/*from w ww . j a v a 2s. c o m*/ } } } return files; } }