Skip to content

Instantly share code, notes, and snippets.

@pfmaggi
Created March 31, 2020 17:39
Show Gist options
  • Save pfmaggi/e995a13f85d6abfdd3a48525f0ecaad6 to your computer and use it in GitHub Desktop.
Save pfmaggi/e995a13f85d6abfdd3a48525f0ecaad6 to your computer and use it in GitHub Desktop.
Code for the Medium article: "Customizing WorkManager"
/* Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
class MyApplication : Application(), Configuration.Provider {
@Inject lateinit var myWorkerFactory: MyWorkerFactory
...
override fun getWorkManagerConfiguration(): Configuration =
Configuration.Builder()
.setMinimumLoggingLevel(android.util.Log.INFO)
.setWorkerFactory(myWorkerFactory)
.build()
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment