Udostępnij za pośrednictwem


ContextWrapper.OpenOrCreateDatabase Method

Definition

Overloads

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory)

Open a new private SQLiteDatabase associated with this Context's application package.

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory, IDatabaseErrorHandler)

Open a new private SQLiteDatabase associated with this Context's application package.

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory)

Open a new private SQLiteDatabase associated with this Context's application package.

[Android.Runtime.Register("openOrCreateDatabase", "(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;", "GetOpenOrCreateDatabase_Ljava_lang_String_ILandroid_database_sqlite_SQLiteDatabase_CursorFactory_Handler")]
public override Android.Database.Sqlite.SQLiteDatabase? OpenOrCreateDatabase (string? name, Android.Content.FileCreationMode mode, Android.Database.Sqlite.SQLiteDatabase.ICursorFactory? factory);
[<Android.Runtime.Register("openOrCreateDatabase", "(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;)Landroid/database/sqlite/SQLiteDatabase;", "GetOpenOrCreateDatabase_Ljava_lang_String_ILandroid_database_sqlite_SQLiteDatabase_CursorFactory_Handler")>]
override this.OpenOrCreateDatabase : string * Android.Content.FileCreationMode * Android.Database.Sqlite.SQLiteDatabase.ICursorFactory -> Android.Database.Sqlite.SQLiteDatabase

Parameters

name
String

The name (unique in the application package) of the database.

mode
FileCreationMode

Operating mode. Use 0 or Private for the default operation, WorldReadable and WorldWriteable to control permissions. Use Android.Content.Context.MODE_ENABLE_WRITE_AHEAD_LOGGING to enable write-ahead logging by default.

factory
SQLiteDatabase.ICursorFactory

An optional factory class that is called to instantiate a cursor when query is called.

Returns

Attributes

Remarks

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

OpenOrCreateDatabase(String, FileCreationMode, SQLiteDatabase+ICursorFactory, IDatabaseErrorHandler)

Open a new private SQLiteDatabase associated with this Context's application package.

[Android.Runtime.Register("openOrCreateDatabase", "(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;Landroid/database/DatabaseErrorHandler;)Landroid/database/sqlite/SQLiteDatabase;", "GetOpenOrCreateDatabase_Ljava_lang_String_ILandroid_database_sqlite_SQLiteDatabase_CursorFactory_Landroid_database_DatabaseErrorHandler_Handler")]
public override Android.Database.Sqlite.SQLiteDatabase? OpenOrCreateDatabase (string? name, Android.Content.FileCreationMode mode, Android.Database.Sqlite.SQLiteDatabase.ICursorFactory? factory, Android.Database.IDatabaseErrorHandler? errorHandler);
[<Android.Runtime.Register("openOrCreateDatabase", "(Ljava/lang/String;ILandroid/database/sqlite/SQLiteDatabase$CursorFactory;Landroid/database/DatabaseErrorHandler;)Landroid/database/sqlite/SQLiteDatabase;", "GetOpenOrCreateDatabase_Ljava_lang_String_ILandroid_database_sqlite_SQLiteDatabase_CursorFactory_Landroid_database_DatabaseErrorHandler_Handler")>]
override this.OpenOrCreateDatabase : string * Android.Content.FileCreationMode * Android.Database.Sqlite.SQLiteDatabase.ICursorFactory * Android.Database.IDatabaseErrorHandler -> Android.Database.Sqlite.SQLiteDatabase

Parameters

name
String

The name (unique in the application package) of the database.

mode
FileCreationMode

Operating mode. Use 0 or Private for the default operation, WorldReadable and WorldWriteable to control permissions. Use Android.Content.Context.MODE_ENABLE_WRITE_AHEAD_LOGGING to enable write-ahead logging by default.

factory
SQLiteDatabase.ICursorFactory

An optional factory class that is called to instantiate a cursor when query is called.

errorHandler
IDatabaseErrorHandler

the IDatabaseErrorHandler to be used when sqlite reports database corruption. if null, DefaultDatabaseErrorHandler is assumed.

Returns

Attributes

Remarks

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