Resources.GetDrawable Resources.GetDrawable Method

Definition

Overloads

GetDrawable(Int32) GetDrawable(Int32)

Return a drawable object associated with a particular resource ID.

GetDrawable(Int32, Resources+Theme) GetDrawable(Int32, Resources+Theme)

Return a drawable object associated with a particular resource ID and styled for the specified theme.

GetDrawable(Int32) GetDrawable(Int32)

Warning

This API is now obsolete.

Return a drawable object associated with a particular resource ID.

[Android.Runtime.Register("getDrawable", "(I)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_IHandler")]
[System.Obsolete("deprecated")]
public virtual Android.Graphics.Drawables.Drawable GetDrawable (int id);
abstract member GetDrawable : int -> Android.Graphics.Drawables.Drawable
override this.GetDrawable : int -> Android.Graphics.Drawables.Drawable

Parameters

id
Int32 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.

Returns

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

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.

GetDrawable(Int32, Resources+Theme) GetDrawable(Int32, Resources+Theme)

Return a drawable object associated with a particular resource ID and styled for the specified theme.

[Android.Runtime.Register("getDrawable", "(ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;", "GetGetDrawable_ILandroid_content_res_Resources_Theme_Handler", ApiSince=21)]
public virtual Android.Graphics.Drawables.Drawable GetDrawable (int id, Android.Content.Res.Resources.Theme theme);
abstract member GetDrawable : int * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable
override this.GetDrawable : int * Android.Content.Res.Resources.Theme -> Android.Graphics.Drawables.Drawable

Parameters

id
Int32 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.

theme
Resources.Theme Resources.Theme

The theme used to style the drawable attributes, may be null.

Returns

Exceptions

Throws NotFoundException if the given ID does not exist.

Remarks

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