How to store sqlite database directly on sdcard

后端 未结 6 1018
小蘑菇
小蘑菇 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:18

    Just give path in constructor ;

     DatabaseHelper(Context context) {
        super(context, Environment.getExternalStorageDirectory()
                + File.separator + "/DataBase/" + File.separator
                + DB_NAME, null, DB_VERSION);
    }
    

提交回复
热议问题