Android.Content.ContentProviderAttribute Class
Generates a /manifest/application/provider element within AndroidManifest.xml.

See Also: ContentProviderAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
public class ContentProviderAttribute : Attribute

See Also

Android.App.MetaDataAttribute
GrantUriPermissionAttribute

Remarks

The //provider element is used to declare a content provider that provides access to structured data managed by the application. The Android.Content.ContentProviderAttribute custom attribute is used by monodroid.exe when generating AndroidManifest.xml to to declaratively generate //provider elements.

The type this attribute is placed on must be a (possibly indirect) subclass of Android.Content.ContentProvider.

The following type declaration

C# Example

[ContentProvider (new[]{"com.example.Provider"}
        Label="Content Label")]
class MyContentProvider : ContentProvider {
    /* ... */
}

results in the following XML fragment

XML Example

<provider android:authorities="com.example.Provider"
            android:label="Content Label" />

In addition, types using the Android.Content.ContentProviderAttribute custom attribute can also use the Android.Content.GrantUriPermissionAttribute and Android.App.MetaDataAttribute custom attributes to declaratively generate the nested //provider/grant-uri-permission and //provider/meta-data elements, respectively.

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0