public class JobManagerCallbackAdapter extends java.lang.Object implements JobManagerCallback
JobManagerCallback. You are advice to override this one
instead so that if new methods are added to the interface, your code won't break.RESULT_CANCEL_CANCELLED_VIA_SHOULD_RE_RUN, RESULT_CANCEL_CANCELLED_WHILE_RUNNING, RESULT_CANCEL_REACHED_RETRY_LIMIT, RESULT_CANCEL_SINGLE_INSTANCE_WHILE_RUNNING, RESULT_FAIL_WILL_RETRY, RESULT_SUCCEED| Constructor and Description |
|---|
JobManagerCallbackAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
onAfterJobRun(Job job,
int resultCode)
Called after a Job is run and its run result has been handled.
|
void |
onDone(Job job)
Called after a Job is removed from the JobManager.
|
void |
onJobAdded(Job job)
Called when a Job is added to the JobManager.
|
void |
onJobCancelled(Job job,
boolean byCancelRequest,
java.lang.Throwable throwable)
Called when a job is cancelled.
|
void |
onJobRun(Job job,
int resultCode)
Called after a Job has been Run.
|
public void onJobAdded(Job job)
JobManagerCallbackonJobAdded in interface JobManagerCallbackjob - The Job that was added to the JobManager.public void onJobRun(Job job, int resultCode)
JobManagerCallbackonJobRun in interface JobManagerCallbackjob - The Job that did just run.resultCode - The result of the Job.onRun(). It is one of:
JobManagerCallback.RESULT_SUCCEEDJobManagerCallback.RESULT_CANCEL_REACHED_RETRY_LIMITJobManagerCallback.RESULT_CANCEL_CANCELLED_WHILE_RUNNINGJobManagerCallback.RESULT_CANCEL_SINGLE_INSTANCE_WHILE_RUNNINGJobManagerCallback.RESULT_CANCEL_CANCELLED_VIA_SHOULD_RE_RUNJobManagerCallback.RESULT_FAIL_WILL_RETRYpublic void onJobCancelled(Job job, boolean byCancelRequest, java.lang.Throwable throwable)
JobManagerCallbackonJobCancelled in interface JobManagerCallbackjob - The Job that was cancelled.byCancelRequest - If true, the Job was cancelled in response to a
JobManager.cancelJobs(TagConstraint, String...) request.throwable - The exception that was thrown from the last execution of Job.onRun()public void onDone(Job job)
JobManagerCallbackonDone in interface JobManagerCallbackjob - The Job that was just removed from the JobManager.public void onAfterJobRun(Job job, int resultCode)
JobManagerCallbackonAfterJobRun in interface JobManagerCallbackjob - The Job that just onFinished a run call.resultCode - The result of the run call.JobManagerCallback.onJobRun(Job, int)