Code example for SQLiteDatabase

Methods: beginTransactionendTransactionexecSQLsetTransactionSuccessful

0
    } 
 
    @Override 
    public void onCreate(SQLiteDatabase db) {
        try { 
            db.beginTransaction();
            db.execSQL("CREATE TABLE tasks (_id INTEGER PRIMARY KEY AUTOINCREMENT, content TEXT, date_created DATE);");
            db.setTransactionSuccessful();
        } finally { 
            db.endTransaction();
        } 
    } 
 
    @Override 
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        throw new RuntimeException("uguu");
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java