我检查了下面的代码
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
Log.d("StatusActivity", "sdcard mounted and writable");
}
else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
Log.d("StatusActivity", "sdcard mounted readonly");
}
else {
Log.d("StatusActivity", "sdcard state: " + state);
}
输出显示sdcard mounted and writable
但Environment.getExternalStorageDirectory().canWrite()
总是返回假。任何人都可以建议吗?