我想在android手機的外部存儲中創建數據庫。 我測試過一個方法存在的數據庫,它返回true。在Android設備監視器中無法看到sdcard內容
但是,我無法在文件資源管理器中看到SD卡的內容。
public static Context context;
public static SQLiteDatabase database;
public static String SDK = Environment.getExternalStorageDirectory().getAbsolutePath();
public static String DB = SDK + "/database/";
context = getApplicationContext(); File file = new File(DB); file.mkdirs(); database = SQLiteDatabase.openOrCreateDatabase(DB + "/db.sqlite", null);
in this picture you can see my file explorer window
this is screenshot of ES File Explorer
你應該看看SDK。什麼是確切的路徑?/storage/emulated/0? – greenapps
@greenapps是SDK =/storage/emulated/0 但模擬的文件夾爲空 –