![]() PeriodicWorkRequest call: PeriodicWorkRequest work = new PeriodicWorkRequest.Builder(ClassExtendingWorker.class, 15, TimeUnit. If you want to execute any task every 10 minutes or on any specific period, you have to use Alarm Manager instead. ![]() Moreover, it will not fire exactly on 15 minutes but it will execute approximately at 15 minutes. Below is my code I'm using for the periodic work request and work itself. So below 15 minutes, it will not work properly. I'm testing my code on Mi Max device with Android API 24 (Nougat) and also enable the auto start manually so that MIUI allows the app to run in background but the problem is, the WorkManager fires for the first time the application starts but after that, it doesn't work. I'm well aware of the restriction introduced by the Android Oreo for background services and that's why I'm using WorkManager API to schedule the task for the execution. I am creating an android application to run my code in background.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |