This class is deprecated.
As of November 1, 2020, GCMNetworkManager client libraries are no longer supported.
GCMNetworkManager API calls no longer work on devices running Android M and later once your
app targets future Android versions ( > Android 10).
Migrate to Jetpack WorkManager for your background
scheduling needs.
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 | This class is deprecated. As of November 1,
2020, GCMNetworkManager client libraries are no longer supported. GCMNetworkManager
API calls no longer work on devices running Android M and later once your app targets
future Android versions ( > Android 10). Migrate to Jetpack WorkManager for your background scheduling needs. |
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 static final Creator<OneoffTask> CREATOR
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.