-
public class OSWorkManagerHelper
-
-
Field Summary
Fields Modifier and Type Field Description public final static OSWorkManagerHelperINSTANCE
-
Method Summary
Modifier and Type Method Description final WorkManagergetInstance(Context context)If there is an instance of WorkManager available, use it. -
-
Method Detail
-
getInstance
@Synchronized() final WorkManager getInstance(Context context)
If there is an instance of WorkManager available, use it. Else, in rare cases, initialize it ourselves.
Calling
WorkManager.getInstance(context)directly can cause an exception if it is null. However, this is the appropriate way to check as the non-throwingWorkManager.getInstance()method does not allow the opportunity for on-demand initialization with custom WorkManager.The purpose of this helper is to work around this bug - https://issuetracker.google.com/issues/258176803
-
-
-
-