Android 创建文件

public File getAlbumStorageDir(String albumName)  { 
    String path = "/sdcard"+"/"+"Test_01";  //"/sdcard"  表示在当前内存目录
    File file = new File(path,albumName);
    if(!file.exists()) {
        try
        {file.createNewFile();}catch (Exception e)
        { e.printStackTrace();}
             Log.d("123","ok"+path);
    }
    return file;
}

你可能感兴趣的:(Android 创建文件)