我在Android上使用WorkManager
发出警报
它可以正常工作,但有时不起作用
您对我的来源有疑问吗?
OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(MyWorker.class)
.addTag("timer")
.setInitialDelay(calsTime, TimeUnit.SECONDS).build();
WorkManager.getInstance().enqueueUniqueWork("timer", ExistingWorkPolicy.REPLACE, mywork);