当前位置: 代码迷 >> 综合 >> AndroidAnnotations——Enhance contentproviders优化ContentProvider
  详细解决方案

AndroidAnnotations——Enhance contentproviders优化ContentProvider

热度:75   发布时间:2023-12-12 00:01:37.0

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 {
        @SystemServiceNotificationManager notificationManager;@BeanMyEnhancedDatastore datastore;@UiThreadvoid showToast() {
        Toast.makeText(getContext().getApplicationContext(), "Hello World!", Toast.LENGTH_LONG).show();}// ... }
  相关解决方案