Sdílet prostřednictvím


SQLiteOpenHelper.OnOpen(SQLiteDatabase) Method

Definition

Called when the database has been opened.

[Android.Runtime.Register("onOpen", "(Landroid/database/sqlite/SQLiteDatabase;)V", "GetOnOpen_Landroid_database_sqlite_SQLiteDatabase_Handler")]
public virtual void OnOpen (Android.Database.Sqlite.SQLiteDatabase? db);
[<Android.Runtime.Register("onOpen", "(Landroid/database/sqlite/SQLiteDatabase;)V", "GetOnOpen_Landroid_database_sqlite_SQLiteDatabase_Handler")>]
abstract member OnOpen : Android.Database.Sqlite.SQLiteDatabase -> unit
override this.OnOpen : Android.Database.Sqlite.SQLiteDatabase -> unit

Parameters

db
SQLiteDatabase

The database.

Attributes

Remarks

Called when the database has been opened. The implementation should check SQLiteDatabase#isReadOnly before updating the database.

This method is called after the database connection has been configured and after the database schema has been created, upgraded or downgraded as necessary. If the database connection must be configured in some way before the schema is created, upgraded, or downgraded, do it in #onConfigure instead.

Java documentation for android.database.sqlite.SQLiteOpenHelper.onOpen(android.database.sqlite.SQLiteDatabase).

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