Skip to content

Instantly share code, notes, and snippets.

@neonankiti
Created September 19, 2019 15:05
Show Gist options
  • Save neonankiti/41294bc1ab39d6c92b39034e236c2671 to your computer and use it in GitHub Desktop.
Save neonankiti/41294bc1ab39d6c92b39034e236c2671 to your computer and use it in GitHub Desktop.
Application class for WorkManager sample
class BisonApplication : Application() {
@SuppressLint("SimpleDateFormat", "HardwareIds")
override fun onCreate() {
super.onCreate()
val factory: AppWorkerFactory = DaggerBisonAppComponent.create().factory()
WorkManager.initialize(this, Configuration.Builder().setWorkerFactory(factory).build())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment