我开始使用Dagger 2并遇到一个奇怪的问题,看起来像是一个bug.
我有3个模块,它们组成一个子组件,后者又扩展/加载更高级别的组件.
子组件非常简单:只需组合模块和单个注入点:
@Singleton
@Subcomponent(
modules = {
NavigationDrawerModule.class,
NavigationListModule.class,
SwitcherModule.class
}
)
public interface NavigationDrawerComponent {
NavigationDrawerFragment inject(NavigationDrawerFragment object);
}
Run Code Online (Sandbox Code Playgroud)
第一个模块看起来像这样 - 它提供了一般的片段级依赖关系:
@Module
public class NavigationDrawerModule {
private final Activity activity;
private final View rootView;
private final LoaderManager loaderManager;
public NavigationDrawerModule(Activity activity, View rootView, LoaderManager loaderManager) {
this.activity = activity;
this.rootView = rootView;
this.loaderManager = loaderManager;
}
@Provides @Singleton EventBus provideLocalBus() {
return EventBus.builder().build();
}
@Provides @Singleton View provideViewRoot() {
return rootView;
}
@Provides @Singleton LoaderManager provideLoaderManager() …
Run Code Online (Sandbox Code Playgroud) GreenDao是否支持多列的唯一约束?相当于以下内容:
create table projects (
_id integer primary key autoincrement,
project_type text,
name text,
unique (project_type, name)
);
Run Code Online (Sandbox Code Playgroud)