Android SQLiteOpenHelper onUpgrade()

‹ Query the COUNT of rows in a SQLite table in Android | What is Gradle? (comparison of gradle vs ant vs make) ›

It's not necessary to wrap your SQLiteOpenHelper.onUpgrade() code in beginTransaction() and endTransaction() pairs, because ever since the earliest version of SQLiteOpenHelper, the Android source code has done this for you:

if (version != mNewVersion) {
    try {
        if (version == 0) {
        } else {
            onUpgrade(db, version, mNewVersion);
    } finally {

Subscribe to All Posts - Wesley Tanaka