Android.Preferences.PreferenceManager.SetDefaultValues Method
Similar to PreferenceManager.SetDefaultValues(Android.Content.Context, System.Int32, System.Int32) but allows the client to provide the filename and mode of the shared preferences file.

Syntax

[Android.Runtime.Register("setDefaultValues", "(Landroid/content/Context;Ljava/lang/String;IIZ)V", "")]
public static void SetDefaultValues (Android.Content.Context context, string sharedPreferencesName, [Android.Runtime.GeneratedEnum] Android.Content.FileCreationMode sharedPreferencesMode, int resId, bool readAgain)

See Also

PreferenceManager.SetDefaultValues(Android.Content.Context, System.Int32, System.Int32)
PreferenceManager.SharedPreferencesName
PreferenceManager.SharedPreferencesMode

Parameters

context
The context of the shared preferences.
sharedPreferencesName
A custom name for the shared preferences file.
sharedPreferencesMode
The file creation mode for the shared preferences file, such as Android.Content.Context.MODE_PRIVATE or Android.Content.Context.MODE_PRIVATE
resId
The resource ID of the preference XML file.
readAgain
Whether to re-read the default values. If false, this method will set the default values only if this method has never been called in the past (or if the PreferenceManager.KeyHasSetDefaultValues in the default value shared preferences file is false). To attempt to set the default values again bypassing this check, set readAgain to true.

Note: this will NOT reset preferences back to their default values. For that functionality, use PreferenceManager.GetDefaultSharedPreferences(Android.Content.Context) and clear it followed by a call to this method with this parameter set to true.

Remarks

Similar to PreferenceManager.SetDefaultValues(Android.Content.Context, System.Int32, System.Int32) but allows the client to provide the filename and mode of the shared preferences file.

[Android Documentation]

Requirements

Namespace: Android.Preferences
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1