See Also: BroadcastReceiverAttribute Members
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.