ContextWrapper.MoveSharedPreferencesFrom(Context, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將現有的共享偏好設定檔案從給定的來源儲存上下文移到這個上下文。 這通常用於升級後的資料在儲存位置間的遷移,例如移動到裝置保護儲存裝置。
[Android.Runtime.Register("moveSharedPreferencesFrom", "(Landroid/content/Context;Ljava/lang/String;)Z", "GetMoveSharedPreferencesFrom_Landroid_content_Context_Ljava_lang_String_Handler", ApiSince=24)]
public override 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)>]
override this.MoveSharedPreferencesFrom : Android.Content.Context * string -> bool
參數
- sourceContext
- Context
原始上下文包含現有的共享偏好,以移動。
- name
- String
共用偏好檔的名稱。
傳回
如果搬遷成功,或是共享偏好在來源上下文中不存在,則為 true;否則為 false。
- 屬性
備註
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。