forked from androidannotations/androidannotations
-
Notifications
You must be signed in to change notification settings - Fork 0
SystemServices
pyricau edited this page Jan 10, 2012
·
7 revisions
Since AndroidAnnotations 1.0
Retrieving Android System Services requires remembering the name of the constant, and casting the retrieved object.
notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);The @SystemService annotation indicates that an activity field should be injected with the corresponding Android System service.
It is the same as calling the Context.getSystemService() method.
Usage example:
@EActivity
public class MyActivity extends Activity {
@SystemService
NotificationManager notificationManager;
}AndroidAnnotations was created by Pierre-Yves Ricau and is sponsored by eBusinessInformations.
04/11/2012 The 2.7 release is out
- Get started!
- Download
- 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