Context.MoveSharedPreferencesFrom(Context, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Move an existing shared preferences file from the given source storage context to this context.
[Android.Runtime.Register("moveSharedPreferencesFrom", "(Landroid/content/Context;Ljava/lang/String;)Z", "GetMoveSharedPreferencesFrom_Landroid_content_Context_Ljava_lang_String_Handler", ApiSince=24)]
public abstract bool MoveSharedPreferencesFrom (Android.Content.Context? sourceContext, string? name);
[<Android.Runtime.Register("moveSharedPreferencesFrom", "(Landroid/content/Context;Ljava/lang/String;)Z", "GetMoveSharedPreferencesFrom_Landroid_content_Context_Ljava_lang_String_Handler", ApiSince=24)>]
abstract member MoveSharedPreferencesFrom : Android.Content.Context * string -> bool
Parameters
- sourceContext
- Context
The source context which contains the existing shared preferences to move.
- name
- String
The name of the shared preferences file.
Returns
true
if the move was successful or if the shared
preferences didn't exist in the source context, otherwise
false
.
- Attributes
Remarks
Move an existing shared preferences 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 moving to device protected storage.
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.