本文整理匯總了Java中com.path.android.jobqueue.di.DependencyInjector類的典型用法代碼示例。如果您正苦於以下問題:Java DependencyInjector類的具體用法?Java DependencyInjector怎麽用?Java DependencyInjector使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DependencyInjector類屬於com.path.android.jobqueue.di包,在下文中一共展示了DependencyInjector類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: jobManager
import com.path.android.jobqueue.di.DependencyInjector; //導入依賴的package包/類
@Provides
@Singleton
public JobManager jobManager() {
Configuration config = new Configuration.Builder(mApp)
.consumerKeepAlive(45)
.maxConsumerCount(3)
.minConsumerCount(1)
.customLogger(L.getJobLogger())
.injector(new DependencyInjector() {
@Override
public void inject(Job job) {
if (job instanceof BaseJob) {
((BaseJob) job).inject(mApp.getAppComponent());
}
}
})
.build();
return new JobManager(mApp, config);
}
示例2: provideJobManager
import com.path.android.jobqueue.di.DependencyInjector; //導入依賴的package包/類
@Provides
@ForActivity
@Singleton
JobManager provideJobManager() {
Configuration config = new Configuration.Builder(activity)
.injector(new DependencyInjector() {
@Override
public void inject(BaseJob baseJob) {
activity.inject(baseJob);
}
})
.id("MainActivity")
.build();
return new JobManager(activity, config);
}
示例3: provideJobManager
import com.path.android.jobqueue.di.DependencyInjector; //導入依賴的package包/類
@Provides
@Singleton
@ForActivity
JobManager provideJobManager() {
Configuration config = new Configuration.Builder(activity)
.injector(new DependencyInjector() {
@Override
public void inject(BaseJob baseJob) {
activity.inject(baseJob);
}
})
.id("LoginActivity")
.build();
return new JobManager(activity, config);
}