Added in API level 1

SQLiteClosable

abstract class SQLiteClosable : Closeable
kotlin.Any
   ↳ android.database.sqlite.SQLiteClosable

An object created from a SQLiteDatabase that can be closed. This class implements a primitive reference counting scheme for database objects.

Summary

Public constructors

Public methods
open Unit

Acquires a reference to the object.

open Unit

Releases a reference to the object, closing the object if the last reference was released.

open Unit

Releases a reference to the object, closing the object if the last reference was released.

open Unit

Releases a reference to the object that was owned by the container of the object, closing the object if the last reference was released.

Protected methods
abstract Unit

Called when the last reference to the object was released by a call to releaseReference() or #close().

open Unit

Called when the last reference to the object was released by a call to releaseReferenceFromContainer().

Public constructors

SQLiteClosable

SQLiteClosable()

Public methods

acquireReference

Added in API level 1
open fun acquireReference(): Unit

Acquires a reference to the object.

Exceptions
java.lang.IllegalStateException if the last reference to the object has already been released.

close

Added in API level 16
open fun close(): Unit

Releases a reference to the object, closing the object if the last reference was released. Calling this method is equivalent to calling releaseReference.

Exceptions
java.lang.Exception if this resource cannot be closed
java.io.IOException if an I/O error occurs

releaseReference

Added in API level 1
open fun releaseReference(): Unit

Releases a reference to the object, closing the object if the last reference was released.

releaseReferenceFromContainer

Added in API level 1
Deprecated in API level 16
open fun releaseReferenceFromContainer(): Unit

Deprecated: Do not use.

Releases a reference to the object that was owned by the container of the object, closing the object if the last reference was released.

Protected methods

onAllReferencesReleased

Added in API level 1
protected abstract fun onAllReferencesReleased(): Unit

Called when the last reference to the object was released by a call to releaseReference() or #close().

onAllReferencesReleasedFromContainer

Added in API level 1
Deprecated in API level 16
protected open fun onAllReferencesReleasedFromContainer(): Unit

Deprecated: Do not use.

Called when the last reference to the object was released by a call to releaseReferenceFromContainer().