Sdílet prostřednictvím


Resources.GetValue Method

Definition

Overloads

GetValue(Int32, TypedValue, Boolean)

Return the raw data associated with a particular resource ID.

GetValue(String, TypedValue, Boolean)

Return the raw data associated with a particular resource ID.

GetValue(Int32, TypedValue, Boolean)

Return the raw data associated with a particular resource ID.

[Android.Runtime.Register("getValue", "(ILandroid/util/TypedValue;Z)V", "GetGetValue_ILandroid_util_TypedValue_ZHandler")]
public virtual void GetValue (int id, Android.Util.TypedValue? outValue, bool resolveRefs);
[<Android.Runtime.Register("getValue", "(ILandroid/util/TypedValue;Z)V", "GetGetValue_ILandroid_util_TypedValue_ZHandler")>]
abstract member GetValue : int * Android.Util.TypedValue * bool -> unit
override this.GetValue : int * Android.Util.TypedValue * bool -> unit

Parameters

id
Int32

The desired resource identifier, as generated by the aapt tool. This integer encodes the package, type, and resource entry. The value 0 is an invalid identifier.

outValue
TypedValue

Object in which to place the resource data.

resolveRefs
Boolean

If true, a resource that is a reference to another resource will be followed so that you receive the actual final resource data. If false, the TypedValue will be filled in with the reference itself.

Attributes

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Return the raw data associated with a particular resource ID.

Java documentation for android.content.res.Resources.getValue(int, android.util.TypedValue, boolean).

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

GetValue(String, TypedValue, Boolean)

Return the raw data associated with a particular resource ID.

[Android.Runtime.Register("getValue", "(Ljava/lang/String;Landroid/util/TypedValue;Z)V", "GetGetValue_Ljava_lang_String_Landroid_util_TypedValue_ZHandler")]
public virtual void GetValue (string? name, Android.Util.TypedValue? outValue, bool resolveRefs);
[<Android.Runtime.Register("getValue", "(Ljava/lang/String;Landroid/util/TypedValue;Z)V", "GetGetValue_Ljava_lang_String_Landroid_util_TypedValue_ZHandler")>]
abstract member GetValue : string * Android.Util.TypedValue * bool -> unit
override this.GetValue : string * Android.Util.TypedValue * bool -> unit

Parameters

name
String

The name of the desired resource. This is passed to getIdentifier() with a default type of "string".

outValue
TypedValue

Object in which to place the resource data.

resolveRefs
Boolean

If true, a resource that is a reference to another resource will be followed so that you receive the actual final resource data. If false, the TypedValue will be filled in with the reference itself.

Attributes

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

Return the raw data associated with a particular resource ID. See getIdentifier() for information on how names are mapped to resource IDs, and getString(int) for information on how string resources are retrieved.

Note: use of this function is discouraged. It is much more efficient to retrieve resources by identifier than by name.

Java documentation for android.content.res.Resources.getValue(java.lang.String, android.util.TypedValue, boolean).

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