Android Guides | Samples

Android.Content.Res.Resources.GetColorStateList Method

Returns a color state list associated with a particular resource ID.

Syntax

[Android.Runtime.Register("getColorStateList", "(I)Landroid/content/res/ColorStateList;", "GetGetColorStateList_IHandler")]
public virtual ColorStateList GetColorStateList (Int32 id)

Parameters

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

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

Returns a color state list associated with a particular resource ID. The resource may contain either a single raw color value or a complex ColorStateList holding multiple possible colors.

[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