0

sdcard の MyDataBase という名前のディレクトリに mdatabase.db ファイルを作成しました。電話で sdcard を開くとディレクトリとファイルが表示されますが、デバイスをシステムに接続し、システムを介して作成されたファイルを開くと問題ありません。表示されていません。お願い助けて

この問題は、組み込みの SD カード デバイスでのみ発生しています。

データベース パス mnt/sdcard/MyDataBase/mdatabase.db

4

1 に答える 1

0

このコードを使用して、メディアの可用性を確認します

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;
}

あなたのコードはそれに依存していますか

詳細については

于 2013-05-01T13:06:37.337 に答える