我正在尝试在外部存储中创建一个文件夹,我在这里跟踪了几个其他线程.然而,即使我似乎在做他们指出的事情,创作也会失败.
这是一段代码
boolean mExternalStorageAvailable = false;
boolean mExternalStorageWriteable = false;
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
mExternalStorageAvailable = true;
mExternalStorageWriteable = true;
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
mExternalStorageAvailable = true;
mExternalStorageWriteable = false;
} else {
mExternalStorageAvailable = false;
mExternalStorageWriteable = false;
}
File exst = Environment.getExternalStorageDirectory();
String exstPath = exst.getPath();
File fooo = new File(exstPath+"/fooo");
boolean success = fooo.mkdir();
当我执行它时,我得到了这个:
mExternalStorageAvailable = true;
mExternalStorageWriteable = true;
success = false;
这是整个清单文件:
package="com.mydev.mobile.Test"
android:versionCode="1"
android:versionName="1.0" >
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
android:label="@string/app_name"
android:name=".TestIndexSearchForHitsAndroidActivity" >
我究竟做错了什么?谢谢!