Android Guides | Samples

Android.Content.GrantUriPermissionAttribute Class

Generates a /manifest/provider/grant-uri-permission elements within AndroidManifest.xml.

See Also: GrantUriPermissionAttribute

Syntax

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

See Also

Remarks

The //provider/grant-uri-permission element is used to specify which data subsets of the parent content provider that permission can be granted for. The GrantUriPermissionAttribute custom attribute is used by monodroid.exe when generating AndroidManifest.xml to to declaratively generate //provider/grant-uri-permission elements.

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

The following type declaration

C# Example

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

results in the following XML fragment

XML Example

<provider android:authorities="com.example.Provider"
            android:label="Content Label">
    <grant-uri-permission pndroid:path="path" />
</provider>

Requirements

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

The members of Android.Content.GrantUriPermissionAttribute are listed below.

See Also: Attribute

Public Constructors

Constructs and initializes a new GrantUriPermissionAttribute instance.

Public Properties

PathString. A complete path identifying the data subset or subsets that permission can be granted for.
PathPatternString. A complete path identifying the data subset or subsets that permission can be granted for, with possible wildcards.
PathPrefixString. The initial part of a path identifying the data subset or subsets that permission can be granted for.