Database not getting copied properly in OnePlus Two

前端 未结 3 963
再見小時候
再見小時候 2020-12-28 15:51

I am creating an Android Application and I am using sqlite database in it. for that I have placed a sqlite file in assets folder of project and I am copying this file to pho

3条回答
  •  感情败类
    2020-12-28 16:28

    Database path may be different in different devices. You need to use Context.getDatabasePath(String) in order to get database path.

    e.g.

    File backupDB = context.getDatabasePath(backupDBPath);
    

提交回复
热议问题