Repository navigation
SystemServices
pyricau edited this page Jan 10, 2012
·
7 revisions
Since AndroidAnnotations 1.0
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.
The field type is used to determine which system service should be injected. The field must not be private.
Usage example:
@SystemService
NotificationManager notificationManager;Equivalent boilerplate code:
NotificationManager notificationManager;
@Override
public void onCreate(Bundle savedInstanceState) {
[...]
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
}AndroidAnnotations was created by Pierre-Yves Ricau and was originally sponsored by eBusinessInformations.
10/07/2015 The 3.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
- Ask on Gitter