Any way to have initial delay for PeriodicWorkRequest

后端 未结 2 1166
粉色の甜心
粉色の甜心 2021-02-14 12:40

For OneTimeWorkRequest, we can have setInitialDelay to specific the initial delay.

However, there isn\'t such facility for PeriodicWorkRe

2条回答
  •  眼角桃花
    2021-02-14 13:08

    Since androidx.work:work-*:2.1.0, PeriodicWorkRequests support initial delays. You can use the setInitialDelay method on PeriodicWorkRequest.Builder to set an initial delay.

    See link for official documentation.

提交回复
热议问题