Android.Preferences.Preference.OnSetInitialValue Method
Implement this to set the initial value of the Preference.

Syntax

[Android.Runtime.Register("onSetInitialValue", "(ZLjava/lang/Object;)V", "GetOnSetInitialValue_ZLjava_lang_Object_Handler")]
protected virtual void OnSetInitialValue (bool restorePersistedValue, Java.Lang.Object defaultValue)

Parameters

restorePersistedValue
True to restore the persisted value; false to use the given defaultValue.
defaultValue
The default value for this Preference. Only use this if restorePersistedValue is false.

Remarks

Implement this to set the initial value of the Preference.

If restorePersistedValue is true, you should restore the Preference value from the Android.Content.ISharedPreferences. If restorePersistedValue is false, you should set the Preference value to defaultValue that is given (and possibly store to SharedPreferences if Preference.ShouldPersist is true).

This may not always be called. One example is if it should not persist but there is no default value given.

[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