我目前有一个我在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)