forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance services
pyricau edited this page Jan 12, 2012
·
10 revisions
Since AndroidAnnotations 2.3
Feature not implemented yet
You can enhance an Android Service with the @EService annotation:
@EService
public class MyService extends Service {
}You can then start using most AA annotations, except the ones related to views and extras:
@EService
public class MyService extends IntentService {
@SystemService
NotificationManager notificationManager;
@Inject
MyEnhancedDatastore datastore;
@RestService
MyService myService;
public MyService() {
super(MyService.class.getSimpleName());
}
@Override
protected void onHandleIntent(Intent intent) {
// Do some stuff...
showToast();
}
@UiThread
void showToast() {
Toast.makeText(getApplicationContext(), "Hello World!", Toast.LENGTH_LONG).show();
}
}14/06/2012 The 2.6 release is out
- Get started!
- Cookbook, full of recipes
- List of all available annotations
- Release Notes
- Examples
- Read the FAQ
- Join the Mailing list
- Create an issue
- Tag on Stack Overflow