
org.droitateddb.DbClosingCursor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
droitatedDB is a lightweight framework, which frees you from the burden of dealing with Androids SQLite
database directly if you don't want to
and let's you access it directly if you have to.
package org.droitateddb;
import android.database.Cursor;
import android.database.CursorWrapper;
/**
* A cursor also handling the reduction of open database connections when closed. It should be used e.g. in combination with CursorAdapter.
*
* @author Falk Appel
* @author Alexander Frank
*/
class DbClosingCursor extends CursorWrapper {
private final DbCreator dbCreator;
public DbClosingCursor(Cursor cursor, DbCreator dbCreator) {
super(cursor);
this.dbCreator = dbCreator;
}
@Override
public void close() {
super.close();
dbCreator.reduceDatabaseConnection();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy