create New Folder - Android java.io

Android examples for java.io:Folder

Description

create New Folder

Demo Code

import android.app.Activity;
import android.text.TextUtils;
import java.io.File;

public class Main{

    public static boolean createNewFolder(File currentDirectory,
            String foldername) {/*from  w w w  .j  a va 2  s. co m*/
        if (!TextUtils.isEmpty(foldername)) {
            File file = new File(currentDirectory, foldername);
            if (file.mkdirs()) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }

}

Related Tutorials