Created
May 26, 2023 13:35
-
-
Save DHosseiny/f13c0a2fd00b327912d3dcacaf4d7124 to your computer and use it in GitHub Desktop.
MyApplication3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@HiltAndroidApp | |
class MyApplication : Application(), Configuration.Provider { | |
@Inject | |
lateinit var hiltWorkerFactory: HiltWorkerFactory | |
private val workerProviders = | |
HashMap<Class<out ListenableWorker>, Provider<AssistedWorkerFactory>>() | |
override fun getWorkManagerConfiguration(): Configuration { | |
return Configuration.Builder().setWorkerFactory( | |
AggregatorWorkerFactory( | |
hiltWorkerFactory, DaggerWorkerFactory(workerProviders) | |
) | |
).build() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment