Code example for List

Methods: add

0
public class FileUtils { 
 
    static List<String> imageExts = new ArrayList<String>();
     
    static { 
        imageExts.add("png");
        imageExts.add("gif");
        imageExts.add("jpeg");
        imageExts.add("jpg");
        imageExts.add("bmp");
    } 
     
    public static boolean save(String filename, String data) {
        String state = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED.equals(state)) {
            BufferedWriter out = null;
            FileWriter fstream = null;
            try { 
                File rootDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/download");
                if (!rootDir.exists()) {
                    rootDir.mkdirs();