How to store sqlite database directly on sdcard

后端 未结 6 1015
小蘑菇
小蘑菇 2020-11-27 05:54

i want to create my sqlite database in sdcard instead of default path...i want to access all my data from sdcard also I have Used This Code:

            priv         


        
6条回答
  •  感情败类
    2020-11-27 06:17

    I created my DB with

        public DatabaseHelper(final Context context) {
        super(context, Environment.getExternalStorageDirectory()
                + File.separator + FILE_DIR
                + File.separator + DATABASE_NAME, null, DATABASE_VERSION);
    }
    

    and had no problems further on. I guess your call to super() should reference the sdcard as well.

提交回复
热议问题