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