Code example for SQLiteOpenHelper

Methods: onCreateonOpen

0
 
    @Implementation 
    public synchronized SQLiteDatabase getReadableDatabase() {
        if (database == null) {
            database = SQLiteDatabase.openDatabase("path", null, 0);
            realHelper.onCreate(database);
        } 
 
        realHelper.onOpen(database);
        return database;
    } 
 
    @Implementation 
    public synchronized SQLiteDatabase getWritableDatabase() {
        if (database == null) {
            database = SQLiteDatabase.openDatabase("path", null, 0);
            realHelper.onCreate(database);
        } 
 
        realHelper.onOpen(database);