定期任务完成后,状态为WorkInfo.State.ENQUEUED
。 isFinished
或state == WorkInfo.State.SUCCEEDED
永远不会为真。
override fun onChanged(wi: WorkInfo?) {
wi?.let {
val state = wi.state
if (!state == WorkInfo.State.ENQUEUED) return
// handle
}
}