我想创建一个目录和代码运行而不引发异常,但目录没有创建(使用Mac上的Android文件传输应用程序进行检查)。日志中没有条目。这里出了什么问题? 权限到位目录没有创建
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/>
下面的代码:
File path = getFilesDir();
File filenew = null;
try {
filenew= new File(path+"/equation");
filenew.mkdirs();
} catch (Exception e) {
e.printStackTrace();
}
getFilesDir()“的getPath +。 /等式“ –
可能du plicate [如何在Android中创建目录?](http://stackoverflow.com/questions/4776426/how-to-create-a-directory-in-android) – duggu
尝试'File filenew = new File(getFilesDir( ),“equation”);)filenew.mkdirs()' –