Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android java onUpgrade()

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    // Loop through each version when an upgrade occurs.
    for (int version = oldVersion + 1; version <= newVersion; version++) {
        switch (version) {

            case 2:
                // Apply changes made in version 2
                db.execSQL(
                    "ALTER TABLE " +
                    TABLE_PRODUCTS +
                    " ADD COLUMN " +
                    COLUMN_DESCRIPTION +
                    " TEXT;"
                );
                break;

            case 3:
                // Apply changes made in version 3
                db.execSQL(CREATE_TABLE_TRANSACTION);
                break;
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: java i/o streams 
Java :: Clicking on Fragment goes through in Activity 
Java :: JSP Convertir Int a String 
Java :: near "@gmail": syntax error 
Java :: get top 3 entries based on values map java 
Java :: open youtube in landscape mode on button click in android progmatically 
Java :: java skip foreach 
Java :: compare string length of two strings 
Java :: compiling and running program in terminal 
Java :: How to center a print statement text? 
Java :: android how to get position of a row in listview 
Java :: class generique java 
Java :: Accesses Constructor of Abstract Classes 
Java :: How to code the Fibonacci Sequence using simple iterative loops in java 
Java :: android java update image dynamically 
Java :: validate data type in request body spring validation 
Java :: java trim unicode u200b 
Java :: 2 multiples recursion 
Java :: jdbc code 
Java :: adding new field in existing kibana index using spark java 
Java :: how to print a sentence out in a string of camel case java 
Java :: datapicker java 
Java :: fail if condition not met in java if condition 
Java :: java escribir ventana grafica 
Java :: thread Exemple 
Java :: h2-gramer-conf 
Java :: Java Multiple element Annotations 
Java :: int array to map java 
Java :: java runtime.getruntime().exec 
Java :: java length of array 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =