代替:
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROp TABLE IF EXISTS notes"); onCreate(db); }
我不得不像下面这样修改方法:
@Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); db.execSQL("DROP TABLE IF EXISTS notes"); db.execSQL("DROP TABLE IF EXISTS routes"); // line added onCreate(db); }
而我不是:
private static final int DATAbase_VERSION = 2;
我将其更改为:
private static final int DATAbase_VERSION = 3;
但是,我并不完全意识到REAL对更改数据库版本产生了影响。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)