A task that will execute once,at some point within the specified window.
If one of cancelTask(String, Class)
or
cancelAllTasks(Class)
is called before this
executes it will be cancelled.
Note that you can request a one-off task to be executed at any point in the future, but to
prevent abuse the scheduler will only set an alarm at a minimum of 30 seconds in the
future. Your task can still be run earlier than this if some network event occurs to wake up
the scheduler.
Nested Class Summary
class | OneoffTask.Builder |
Inherited Constant Summary
Field Summary
public static final Creator<OneoffTask> | CREATOR |
Public Method Summary
long | |
long | |
void | |
String |
toString()
|
void |
writeToParcel(Parcel parcel, int flags)
|
Inherited Method Summary
Fields
Public Methods
public long getWindowEnd ()
Returns
- The number of seconds from now by which this task must have executed.
public long getWindowStart ()
Returns
- The number of seconds from now at which this task is eligible for execution.
public void toBundle (Bundle bundle)
Insert the task object into the provided bundle for IPC. Use #fromBundle to recreate the object on the other side.