SQLite Android . unable to open database file

前端 未结 2 625
刺人心
刺人心 2020-12-19 05:01

I found a lot of question about this problem, but i can\'t fix it. I have a sqlite db in assets folder:

assets/data/data/{package_name}/databases/mydb.db
         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-19 05:56

    Instead of hard coded DB_PATH (no longer work in JB), I would recommend always go with Android inbuilt API method,

    mContext.getDatabasePath(DATABASE_NAME).getPath();
    

提交回复
热议问题