Android.Content.BroadcastReceiverAttribute Class
Generates a /manifest/application/receiver element within AndroidManifest.xml.

See Also: BroadcastReceiverAttribute Members

Syntax

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

See Also

Android.App.IntentFilterAttribute
Android.App.MetaDataAttribute

Remarks

The //receiver element is used to declare a receiver, which are used to enable applications to reveive intents that are broadcast by the system or by otehr applications, even when other components of the application are not running. The Android.Content.BroadcastReceiverAttribute custom attribute is used by monodroid.exe when generating AndroidManifest.xml to to declaratively generate //receiver elements.

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

The following type declaration

C# Example

[BroadcastReceiver (Name="mono.samples.HelloReceiver", 
        Label="Receiver Label")]
class MyReceiver : BroadcastReceiver {
}

results in the following XML fragment:

XML Example

<receiver
            android:label="Receiver Label" 
            android:name="mono.samples.HelloReceiver" />

In addition, types using the Android.Content.BroadcastReceiverAttribute custom attribute can also use the Android.App.IntentFilterAttribute and Android.App.MetaDataAttribute custom attributes to declaratively generate the nested //receiver/intent-filter and //receiver/meta-data elements, respectively.

Requirements

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