Job job = dispatcher.newJobBuilder()
.setTag("JOB_TAG")
.setService(MyService.class)
.setTrigger(Trigger.NOW)
.setReplaceCurrent(false)
.setRetryStrategy(RetryStrategy.DEFAULT_EXPONENTIAL)
.setConstraints(Constraint.ON_ANY_NETWORK)
.build();
dispatcher.schedule(job);
my code is here. even when all conditions are here, my job starts with delay. Can i trigger it somehow?
Use Trigger.executionWindow(0, 0)
instead of Trigger.NOW
.It will normally start your job immediately or within 1 second.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With