Sdílet prostřednictvím


Preference.OnGetDefaultValue(TypedArray, Int32) Method

Definition

Called when a Preference is being inflated and the default value attribute needs to be read.

[Android.Runtime.Register("onGetDefaultValue", "(Landroid/content/res/TypedArray;I)Ljava/lang/Object;", "GetOnGetDefaultValue_Landroid_content_res_TypedArray_IHandler")]
protected virtual Java.Lang.Object? OnGetDefaultValue (Android.Content.Res.TypedArray? a, int index);
[<Android.Runtime.Register("onGetDefaultValue", "(Landroid/content/res/TypedArray;I)Ljava/lang/Object;", "GetOnGetDefaultValue_Landroid_content_res_TypedArray_IHandler")>]
abstract member OnGetDefaultValue : Android.Content.Res.TypedArray * int -> Java.Lang.Object
override this.OnGetDefaultValue : Android.Content.Res.TypedArray * int -> Java.Lang.Object

Parameters

a
TypedArray

The set of attributes.

index
Int32

The index of the default value attribute.

Returns

The default value of this preference type.

Attributes

Remarks

Called when a Preference is being inflated and the default value attribute needs to be read. Since different Preference types have different value types, the subclass should get and return the default value which will be its value type.

For example, if the value type is String, the body of the method would proxy to TypedArray#getString(int).

Java documentation for android.preference.Preference.onGetDefaultValue(android.content.res.TypedArray, 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