다음을 통해 공유


IPreferenceDataStore.GetString(String, String) Method

Definition

Retrieve a String value from the data store.

[Android.Runtime.Register("getString", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "GetGetString_Ljava_lang_String_Ljava_lang_String_Handler:Android.Preferences.IPreferenceDataStore, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public virtual string? GetString (string? key, string? defValue);
[<Android.Runtime.Register("getString", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", "GetGetString_Ljava_lang_String_Ljava_lang_String_Handler:Android.Preferences.IPreferenceDataStore, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member GetString : string * string -> string
override this.GetString : string * string -> string

Parameters

key
String

The name of the preference to retrieve.

defValue
String

Value to return if this preference does not exist.

Returns

Attributes

Remarks

Retrieve a String value from the data store.

Java documentation for android.preference.PreferenceDataStore.getString(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