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 periodic task is one that will recur at the specified interval, without needing to be
rescheduled. Schedule a task that will recur until the user calls one of
cancelAllTasks(Class)
, or
cancelTask(String, Class)
with an identifying tag.
Periodic tasks will not be scheduled if their period is below a certain minimum (currently 30 seconds).
Nested Class Summary
class | PeriodicTask.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<PeriodicTask> | CREATOR | |
protected long | mFlexInSeconds | |
protected long | mIntervalInSeconds |
Public Method Summary
long |
getFlex()
|
long | |
void | |
String |
toString()
|
void |
writeToParcel(Parcel parcel, int
flags)
|
Inherited Method Summary
Fields
public static final Creator<PeriodicTask> CREATOR
protected long mFlexInSeconds
protected long mIntervalInSeconds
Public Methods
public long getFlex ()
Returns
- The number of seconds before the end of the period returned via
getPeriod()
that this periodic task can be executed early.
public long getPeriod ()
Returns
- The period for this task. The number of seconds between subsequent executions.
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.