Work manager periodic task not working on Samsung( Android version 9.0)
Asked Answered
H

0

7

I configured a periodic work manager request and seems like it's working on Pixel(Android version 9.0) but fails on Samsung device which is also running on 9.0

//Work manager request
final PeriodicWorkRequest workRequest = new PeriodicWorkRequest.Builder(MyWorker.class, 1, TimeUnit.HOURS).build();

WorkManager.getInstance().enqueueUniquePeriodicWork("My_TASK", ExistingPeriodicWorkPolicy.REPLACE, workRequest);

// My worker
public class MyWorker extends Worker {

public MyWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) {
    super(context, workerParams);
}

@NonNull
@Override
public Result doWork() {
    //some work
    return Result.success();
}
}
Hesperidium answered 15/7, 2019 at 19:11 Comment(3)
Can you add some information about the failure you see on the Samsung device? Do you have any log?Sharpedged
@Sharpedged I added the same logic to a different project which doesn't have firebase config and it seems like working fine. I will try to get some more info on this and get back to you.Hesperidium
have you resolved this issue? what you have doneBrno

© 2022 - 2024 — McMap. All rights reserved.