Java tutorial
//package com.java2s; import java.util.Vector; import android.content.Context; public class Main { public static String[] getPuzzleFiles(Context context) { String[] files = context.fileList(); Vector<String> puzzleFiles = new Vector<String>(); for (String file : files) if (file.endsWith(".pfy")) puzzleFiles.add(file); String[] ret = new String[0]; return puzzleFiles.toArray(ret); } }