use of com.tool.common.integration.ConfigModule in project MVPFrames by RockyQu.
the class AppDelegate method onCreate.
@Override
public void onCreate(Application application) {
this.application = application;
component = DaggerAppComponent.builder().appModule(new AppModule(application)).httpModule(// Http模块
new HttpModule()).appConfigModule(// 全局配置
getAppConfigModule(application, modules)).build();
component.inject(this);
// 存放配置接口ConfigModule
component.extras().put(ConfigModule.class.getName(), modules);
this.modules = null;
// 注入Activity生命周期
application.registerActivityLifecycleCallbacks(activityLifecycle);
for (Application.ActivityLifecycleCallbacks lifecycle : activityLifecycles) {
application.registerActivityLifecycleCallbacks(lifecycle);
}
// 内存回收管理接口
componentCallbacks = new AppComponentCallbacks(application, component);
application.registerComponentCallbacks(componentCallbacks);
// 注入Application生命周期
for (ApplicationLifecycles lifecycle : applicationLifecycles) {
lifecycle.onCreate(application);
}
}
Aggregations