package Ġcom . example Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . work . Configuration Ċ import Ġandroidx . work . One Time Work Request Ċ import Ġandroidx . work . Work Manager Ċ import Ġcom . example . inject . D agger App Component Ċ import Ġcom . example . worker . Inject ed Worker Ċ import Ġcom . example . worker . Non Inject ed Worker Ċ import Ġcom . vik ings en . inject . worker . Worker Factory Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠApp Ġ: ĠApplication (), ĠConfiguration . Provider Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġworker Factory : ĠWorker Factory ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate () ĊĠĠĠĠĠĠĠ ĠD agger App Component . create (). inject ( this ) ĊĊĠĠĠĠĠĠĠ Ġval Ġwork Manager Ġ= ĠWork Manager . getInstance ( this ) ĊĠĠĠĠĠĠĠ Ġwork Manager . enqueue ( One Time Work Request . from ( Inject ed Worker :: class . java )) ĊĠĠĠĠĠĠĠ Ġwork Manager . enqueue ( One Time Work Request . from ( Non Inject ed Worker :: class . java )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Work Manager Configuration (): ĠConfiguration Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠConfiguration . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Worker Factory ( worker Factory ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġ} Ċ }