0
我已經在SD卡上創建了一個名爲MyDataBase的目錄下的mdatabase.db文件,這很好,當我通過手機打開SD卡時,目錄和文件正在顯示,但是當我將設備連接到系統並通過系統打開創建的文件未顯示。 請幫助我如何讓文件存儲在內置的外部存儲
這個問題只在抵達內置SD卡的設備,我
DataBasepath MNT/SD卡/ MYDATABASE/mdatabase.db
我已經在SD卡上創建了一個名爲MyDataBase的目錄下的mdatabase.db文件,這很好,當我通過手機打開SD卡時,目錄和文件正在顯示,但是當我將設備連接到系統並通過系統打開創建的文件未顯示。 請幫助我如何讓文件存儲在內置的外部存儲
這個問題只在抵達內置SD卡的設備,我
DataBasepath MNT/SD卡/ MYDATABASE/mdatabase.db
使用此代碼檢查介質的可用性
boolean mExternalStorageAvailable = false;
boolean mExternalStorageWriteable = false;
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
// We can read and write the media
mExternalStorageAvailable = mExternalStorageWriteable = true;
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
// We can only read the media
mExternalStorageAvailable = true;
mExternalStorageWriteable = false;
} else {
// Something else is wrong. It may be one of many other states, but all we need
// to know is we can neither read nor write
mExternalStorageAvailable = mExternalStorageWriteable = false;
}
請問您的代碼取決於您的代碼
確實檢查了您的數據庫存儲在哪裏的fileexplorer – Raghunandan 2013-05-01 11:28:19
?你能提供完整的路徑嗎? – 2013-05-01 12:26:16
@ChintanRathod上面給出 – Sandy09 2013-05-01 12:34:43