您的位置:首页 > 移动开发 > Android开发

AndroidAnnotations——Enhance contentproviders优化ContentProvider

2014-04-06 15:39 357 查看

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();
}

// ...
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: