forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance broadcastreceivers
PerfectCarl edited this page May 29, 2014
·
20 revisions
Since AndroidAnnotations 2.4
You can enhance an Android BroadcastReceiver with the @EReceiver annotation:
@EReceiver
public class MyReceiver extends BroadcastReceiver {
}You can then start using most AA annotations, except the ones related to views and extras:
@EReceiver
public class MyReceiver extends BroadcastReceiver {
@SystemService
NotificationManager notificationManager;
@Bean
SomeObject someObject;
}Your activity/fragment/service can subscribe to event using the @Receiver annotations, instead of declaring a BroadcastReceiver.
@EActivity
public class ActivityWithValidReceiver extends Activity {
@Receiver(actions = "org.androidannotations.ACTION_1")
protected void onAction1() {
}
}More information about the @Receiver annotation.
Since AndroidAnnotations 3.1
AndroidAnnotations was created by Pierre-Yves Ricau and is sponsored by eBusinessInformations.
09/11/2014 The 3.2 release is out !
- Get started!
- Download
- Cookbook, full of recipes
- Customize annotation processing
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow