我面臨存儲卡存在與否的一些奇怪問題。我正在檢查IsSDCARD在我的google nexus設備上呈現它的returing true,但是當我嘗試使用文件資源管理器訪問存儲卡時,它在mnt文件夾中顯示沒有存儲卡(存儲卡之前的arrao不存在)....此處是我的代碼,請幫助存儲卡不存在靜止存儲器檢查返回true
public static boolean isSDCardMounted() {
Boolean isSDPresent = android.os.Environment.getExternalStorageState()
.equals(android.os.Environment.MEDIA_MOUNTED);
Log.d("Tag", "SDCARD PRESENT....." + isSDPresent);
return isSDPresent;
}
if (!DownLoadFile.isSDCardMounted()) {
CommonFunctions.showAlerts(MainActivity.this,
"SD Card Not Available");
if (progressDialog.isShowing())
progressDialog.dismiss();
cancel(true);
}
請幫助.....
變化getExternalStorageDirectory() – Sam
檢查返回值isExternalStorageRemovable(),檢查我的答案的解釋。 – Tarun