JobParameters.CompleteWork(JobWorkItem) Method

Definition

Report the completion of executing a JobWorkItem previously returned by #dequeueWork().

[Android.Runtime.Register("completeWork", "(Landroid/app/job/JobWorkItem;)V", "GetCompleteWork_Landroid_app_job_JobWorkItem_Handler", ApiSince=26)]
public virtual void CompleteWork (Android.App.Job.JobWorkItem work);
[<Android.Runtime.Register("completeWork", "(Landroid/app/job/JobWorkItem;)V", "GetCompleteWork_Landroid_app_job_JobWorkItem_Handler", ApiSince=26)>]
abstract member CompleteWork : Android.App.Job.JobWorkItem -> unit
override this.CompleteWork : Android.App.Job.JobWorkItem -> unit

Parameters

work
JobWorkItem

The work you have completed processing, as previously returned by #dequeueWork()

Attributes

Remarks

Report the completion of executing a JobWorkItem previously returned by #dequeueWork(). This tells the system you are done with the work associated with that item, so it will not be returned again. Note that if this is the last work in the queue, completing it here will <em>not</em> finish the overall job -- for that to happen, you still need to call #dequeueWork() again.

If you are enqueueing work into a job, you must call this method for each piece of work you process. Do <em>not</em> call JobService#jobFinished(JobParameters, boolean) or else you can lose work in your queue.

Java documentation for android.app.job.JobParameters.completeWork(android.app.job.JobWorkItem).

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