Android Guides | Samples

Android.Content.Res.Resources.GetValueForDensity Method

Get the raw value associated with a resource with associated density.

Syntax

[Android.Runtime.Register("getValueForDensity", "(IILandroid/util/TypedValue;Z)V", "GetGetValueForDensity_IILandroid_util_TypedValue_ZHandler")]
public virtual Void GetValueForDensity (Int32 id, Int32 density, TypedValue outValue, Boolean resolveRefs)

See Also

Parameters

id
resource identifier
density
density in DPI
outValue
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

Get the raw value associated with a resource with associated density.

[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 15