Preferences.Put(String, String) Method

Definition

Associates the specified value with the specified key in this preference node.

[Android.Runtime.Register("put", "(Ljava/lang/String;Ljava/lang/String;)V", "GetPut_Ljava_lang_String_Ljava_lang_String_Handler")]
public abstract void Put (string? key, string? value);
[<Android.Runtime.Register("put", "(Ljava/lang/String;Ljava/lang/String;)V", "GetPut_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member Put : string * string -> unit

Parameters

key
String

key with which the specified value is to be associated.

value
String

value to be associated with the specified key.

Attributes

Exceptions

if the given key or value is null.

if the given key's length is bigger than MAX_KEY_LENGTH or the value's length is bigger than MAX_VALUE_LENGTH.

if this node has been removed.

Remarks

Associates the specified value with the specified key in this preference node.

Java documentation for java.util.prefs.Preferences.put(java.lang.String, java.lang.String).

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.

Applies to