Android Guides | Samples

Android.Content.Res.Resources.GetXml Method

Return an XmlResourceParser through which you can read a generic XML resource for the given resource ID.

Syntax

[Android.Runtime.Register("getXml", "(I)Landroid/content/res/XmlResourceParser;", "GetGetXml_IHandler")]
public virtual XmlReader GetXml (Int32 id)

See Also

Parameters

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

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 an XmlResourceParser through which you can read a generic XML resource for the given resource ID.

The XmlPullParser implementation returned here has some limited functionality. In particular, you can't change its input, and only high-level parsing events are available (since the document was pre-parsed for you at build time, which involved merging text and stripping comments).

[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