Compartilhar via


SQLiteOpenHelper.ReadableDatabase Property

Definition

Create and/or open a database.

public virtual Android.Database.Sqlite.SQLiteDatabase? ReadableDatabase { [Android.Runtime.Register("getReadableDatabase", "()Landroid/database/sqlite/SQLiteDatabase;", "GetGetReadableDatabaseHandler")] get; }
[<get: Android.Runtime.Register("getReadableDatabase", "()Landroid/database/sqlite/SQLiteDatabase;", "GetGetReadableDatabaseHandler")>]
member this.ReadableDatabase : Android.Database.Sqlite.SQLiteDatabase

Property Value

a database object valid until #getWritableDatabase or #close is called.

Attributes

Exceptions

if the database cannot be opened

Remarks

Create and/or open a database. This will be the same object returned by #getWritableDatabase unless some problem, such as a full disk, requires the database to be opened read-only. In that case, a read-only database object will be returned. If the problem is fixed, a future call to #getWritableDatabase may succeed, in which case the read-only database object will be closed and the read/write object will be returned in the future.

<p class="caution">Like #getWritableDatabase, this method may take a long time to return, so you should not call it from the application main thread, including from android.content.ContentProvider#onCreate ContentProvider.onCreate().

Java documentation for android.database.sqlite.SQLiteOpenHelper.getReadableDatabase().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to