AndroidAnnotations——Enhance contentproviders优化ContentProvider

来源:互联网 发布:传奇软件加速 编辑:程序博客网 时间:2024/05/15 06:36
 

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的其他注解:

@EProviderpublic class MyContentProvider extends ContentProvider {  @SystemService  NotificationManager notificationManager;  @Bean  MyEnhancedDatastore datastore;  @UiThread  void showToast() {    Toast.makeText(getContext().getApplicationContext(), "Hello World!", Toast.LENGTH_LONG).show();  }  // ...}
0 0