Android Workmanager PeriodicWorkRequest is not unique

余生长醉 提交于 2019-11-30 15:50:17

The IllegalStateException you see was a bug we fixed in alpha01. Use the alpha02 library, and you won't see that problem. For more information, take a look at the release notes here.

Another workaround is to add a tag REQUEST_TAG to the PeriodicWorkRequestBuilder, and then call WorkManager.getInstance().cancelAllWorkByTag(REQUEST_TAG) before you enqueue the periodic request.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!