コード例 #1
0
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

      Log.d(TAG, "Upgrading database.");

      switch (oldVersion) {
        case 1:
          db.execSQL(
              "ALTER TABLE " + BOOKMARKS_DATABASE_TABLE + " ADD " + BOOKMARKS_THUMBNAIL + " BLOB;");
        case 2:
          db.execSQL(
              "ALTER TABLE "
                  + BOOKMARKS_DATABASE_TABLE
                  + " ADD "
                  + BOOKMARKS_COUNT
                  + " INTEGER NOT NULL DEFAULT 0;");
        case 3:
          db.execSQL(ADBLOCK_WHITELIST_DATABASE_CREATE);
          mParent.mAdBlockListNeedPopulate = true;
        case 4:
          db.execSQL(MOBILE_VIEW_DATABASE_CREATE);
        default:
          break;
      }
    }
コード例 #2
0
 @Override
 public void onCreate(SQLiteDatabase db) {
   db.execSQL(BOOKMARKS_DATABASE_CREATE);
   db.execSQL(HISTORY_DATABASE_CREATE);
   db.execSQL(ADBLOCK_WHITELIST_DATABASE_CREATE);
   db.execSQL(MOBILE_VIEW_DATABASE_CREATE);
   mParent.mAdBlockListNeedPopulate = true;
 }