小编Luk*_*224的帖子

从资产文件夹升级Android SQLite数据库

我目前有一个我在Assets文件夹中使用的数据库.我有升级它的问题.每当我提高DATABASE_VERSION数字时,它只会更新某些时间.当它升级时,它会在开始时崩溃,我必须重新打开应用程序.

这是我的createDatabase()

public void createDataBase() throws IOException {
boolean dbExist = checkdatabase();
if (dbExist) {
    Log.v("DB Exists", "db exists");
    // By calling this method here onUpgrade will be called on a
    // writeable database, but only if the version number has been
    // bumped
    this.getWritableDatabase();
}
dbExist = checkdatabase();
if (!dbExist) {
    // By calling this method and empty database will be created into
    // the default system path of your application so we are gonna be
    // …
Run Code Online (Sandbox Code Playgroud)

database sqlite android assets

4
推荐指数
1
解决办法
1974
查看次数

标签 统计

android ×1

assets ×1

database ×1

sqlite ×1