Android Guides | Samples

Android.App.MetaDataAttribute Class

Generates the //meta-data element within AndroidManifest.xml.

See Also: MetaDataAttribute


[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.All, AllowMultiple=true, Inherited=false)]
public sealed class MetaDataAttribute : Attribute


The //meta-data element is used to provide arbitrary data about a component. The MetaDataAttribute custom attribute is used by monodroid.exe when generating AndroidManifest.xml to to declaratively generate the //meta-data elements.

The following type declaration:

C# Example

[MetaData ("foo", Value="bar")]
public class MyActivity : Activity

will generate the following XML fragment within AndroidManifest.xml:

xml Example

<activity android:name="demo.MyActivity" android:label="MyActivity">
    <meta-data android:name="foo" android:value="bar" />


Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:

The members of Android.App.MetaDataAttribute are listed below.

See Also: Attribute

Public Constructors

Constructs and initializes a new MetaDataAttribute instance with the specified meta-data name.

Public Properties

NameString. The name of the meta-data to generate.
ResourceString. A reference to a resource to use as the value.
ValueString. The value of the meta-data.