Enhance contentproviders优化ContentProvider
Since AndroidAnnotations 2.4
You can enhance an Android Content Provider with the
@EProvider
annotation:
你可以使用
@EProvider
优化Android
Content Provider
:
@EProviderpublic class MyContentProvider extends ContentProvider {
}
You can then start using most AA annotations, except the ones related to views and extras:
然后,除了Views和extras相关的注解,你可以使用大多数AA的其他注解:
@EProvider
public class MyContentProvider extends ContentProvider {
@SystemService
NotificationManager notificationManager;
@Bean
MyEnhancedDatastore datastore;
@UiThread
void showToast() {
Toast.makeText(getContext().getApplicationContext(), "Hello World!", Toast.LENGTH_LONG).show();
}
// ...
}