ContextWrapper.MoveDatabaseFrom(Context, String) Method

Definition

Move an existing database file from the given source storage context to this context. This is typically used to migrate data between storage locations after an upgrade, such as migrating to device protected storage. The database must be closed before being moved.

[Android.Runtime.Register("moveDatabaseFrom", "(Landroid/content/Context;Ljava/lang/String;)Z", "GetMoveDatabaseFrom_Landroid_content_Context_Ljava_lang_String_Handler", ApiSince=24)]
public override bool MoveDatabaseFrom(Android.Content.Context? sourceContext, string? name);
[<Android.Runtime.Register("moveDatabaseFrom", "(Landroid/content/Context;Ljava/lang/String;)Z", "GetMoveDatabaseFrom_Landroid_content_Context_Ljava_lang_String_Handler", ApiSince=24)>]
override this.MoveDatabaseFrom : Android.Content.Context * string -> bool

Parameters

sourceContext
Context

The source context which contains the existing database to move.

name
String

The name of the database file.

Returns

true if the move was successful or if the database didn't exist in the source context, otherwise false .

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.

Java documentation for android.content.ContextWrapper.moveDatabaseFrom(android.content.Context, java.lang.String).

Applies to