Code example for SQLiteOpenHelper

Methods: close

0
    } 
 
    @SuppressLint("NewApi") 
    @Override 
    public void shutdown() { 
        mDatabaseHelper.close();
 
        super.shutdown(); 
    } 
 
    public static class MyDatabaseHelper extends SQLiteOpenHelper {
        public static final int DATABASE_VERSION = 1;
        public static final String DATABASE_NAME = "tests.db";
        public static final String CREATE_TABLE_SQL = "CREATE TABLE tests(" + BaseColumns._ID +" INTEGER PRIMARY KEY NOT NULL, name TEXT NOT NULL)";
        public static final String DROP_TABLE_SQL = "DROP TABLE tests;";
 
        public MyDatabaseHelper(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
            Log.v(TAG, "construct");
        }