Compartir a través de


Preferences.PutInt(String, Int32) Method

Definition

Associates a string representing the specified int value with the specified key in this preference node.

[Android.Runtime.Register("putInt", "(Ljava/lang/String;I)V", "GetPutInt_Ljava_lang_String_IHandler")]
public abstract void PutInt (string? key, int value);
[<Android.Runtime.Register("putInt", "(Ljava/lang/String;I)V", "GetPutInt_Ljava_lang_String_IHandler")>]
abstract member PutInt : string * int -> unit

Parameters

key
String

key with which the string form of value is to be associated.

value
Int32

value whose string form is to be associated with key.

Attributes

Exceptions

if the given key is null.

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

if this node has been removed.

Remarks

Associates a string representing the specified int value with the specified key in this preference node. The associated string is the one that would be returned if the int value were passed to Integer#toString(int). This method is intended for use in conjunction with #getInt.

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

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