@Override public final void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { try { onRobustUpgrade(db, oldVersion, newVersion); } catch (SQLiteException e) { // The database has entered an unknown state. Try to recover. try { regenerateTables(db); } catch (SQLiteException e2) { dropAndCreateTables(db); } } }