Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Does creating a table after the database has already been created change the database version in SQLite?
  2. private static class DbWordsHelper extends SQLiteOpenHelper {
  3.  
  4.     private DbWordsHelper(Context context) {
  5.         super(context, DB_NAME, null, DB_VERSION);
  6.     }
  7.        
  8. @Override
  9.     public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  10.  
  11.         // Here in the future should be method that change the schema of the
  12.         // database. Now we just delete
  13.         try {
  14.             db.execSQL(DROP_TABLE_WORDS);
  15.         } catch (SQLException e) {
  16.             Log.e(TAG, "Error while updating database" + TABLE_WORDS, e);
  17.         }
  18.  
  19.         onCreate(db);
  20.  
  21.     }