JobService.JobFinished(JobParameters, Boolean) Method

Definition

Call this to inform the JobScheduler that the job has finished its work.

[Android.Runtime.Register("jobFinished", "(Landroid/app/job/JobParameters;Z)V", "")]
public void JobFinished (Android.App.Job.JobParameters? params, bool wantsReschedule);
[<Android.Runtime.Register("jobFinished", "(Landroid/app/job/JobParameters;Z)V", "")>]
member this.JobFinished : Android.App.Job.JobParameters * bool -> unit

Parameters

params
JobParameters

The parameters identifying this job, as supplied to the job in the #onStartJob(JobParameters) callback.

wantsReschedule
Boolean

true if this job should be rescheduled according to the back-off criteria specified when it was first scheduled; false otherwise. When false is returned for a periodic job, the job will be rescheduled according to its periodic policy.

Attributes

Remarks

Call this to inform the JobScheduler that the job has finished its work. When the system receives this message, it releases the wakelock being held for the job. This does not need to be called if #onStopJob(JobParameters) has been called.

You can request that the job be scheduled again by passing true as the wantsReschedule parameter. This will apply back-off policy for the job; this policy can be adjusted through the android.app.job.JobInfo.Builder#setBackoffCriteria(long, int) method when the job is originally scheduled. The job's initial requirements are preserved when jobs are rescheduled, regardless of backed-off policy. <p class="note"> A job running while the device is dozing will not be rescheduled with the normal back-off policy. Instead, the job will be re-added to the queue and executed again during a future idle maintenance window.

<p class="note"> Any JobInfo.Builder#setUserInitiated(boolean) user-initiated job cannot be rescheduled when the user has asked to stop the app via a system provided affordance (such as the Task Manager). In such situations, the value of wantsReschedule is always treated as false.

Java documentation for android.app.job.JobService.jobFinished(android.app.job.JobParameters, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to