Android Guides | Samples

Android.Content.Res.Resources.GetValue Method

Return the raw data associated with a particular resource ID.

Syntax

[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, TypedValue outValue, Boolean resolveRefs)

Parameters

name
The name of the desired resource. This is passed to getIdentifier() with a default type of "string".
outValue
Object in which to place the resource data.
resolveRefs
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.

Exceptions

TypeReason
!:NoType:android/content/res/Resources$NotFoundException;Href=../../../../reference/android/content/res/Resources.NotFoundException.htmlThrows 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.

[Android Documentation]

Requirements

Namespace: Android.Content.Res
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1