forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance IntentServices
Jérémie Martinez edited this page Jan 15, 2014
·
2 revisions
Since AndroidAnnotations 3.0
You can enhance an Android IntentService with the @EIntentService annotation to simply handle actions in @ServiceAction annotated methods.
As for @EService, you can then start using most AA annotations, except the ones related to views and extras.
@EIntentService
public class MyIntentService extends IntentService {
@ServiceAction
void mySimpleAction() {
// ...
}
@ServiceAction
void myAction(String param) {
// ...
}
@Override
protected void onHandleIntent(Intent intent) {
// Do nothing here
}
}You can start an enhanced IntentService via the inner Builder :
MyIntentService.intent(getApplication()) //
.myAction("test") //
.start();AndroidAnnotations was created by Pierre-Yves Ricau and is sponsored by eBusinessInformations.
12/01/2014 The 3.0.1 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