Class DefaultDatabaseProvider

    • Constructor Detail

      • DefaultDatabaseProvider

        public DefaultDatabaseProvider​(SQLiteOpenHelper sqliteOpenHelper)
        Parameters:
        sqliteOpenHelper - An SQLiteOpenHelper from which to obtain database instances.
    • Method Detail

      • getWritableDatabase

        public SQLiteDatabase getWritableDatabase()
        Description copied from interface: DatabaseProvider
        Creates and/or opens a database that will be used for reading and writing.

        Once opened successfully, the database is cached, so you can call this method every time you need to write to the database. Errors such as bad permissions or a full disk may cause this method to fail, but future attempts may succeed if the problem is fixed.

        Specified by:
        getWritableDatabase in interface DatabaseProvider
        Returns:
        A read/write database object.