How to use WorkManager to run a long running job i

2019-06-13 05:42发布

问题:

Due to the problem mentioned in Proper way to tackle and resolve "Excessive network usage (background)" , I plan to move the long running task (sync to cloud) from background to foreground.

Currently, I start my delayed WorkManager in Application's onPause

I was planning to use WorkManager, to launch an IntentService's startForeground - Android - implementing startForeground for a service?

But, WorkManager itself unable to launch a Service. May I know how I can achieve so?

Is there a way, to use WorkManager to run a long running job in Foreground (With visible UI, like progress bar)