All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.arconsis.android.datarobot.DbClosingCursor Maven / Gradle / Ivy

Go to download

Datarobot for Android 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.

The newest version!
package com.arconsis.android.datarobot;

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 - 2024 Weber Informatics LLC | Privacy Policy