Summary: Nested Classes | Inherited Constants | Fields | Methods | Inherited Methods | [Expand All]
public class

# OneoffTask

extends Task

java.lang.Object
↳ | com.google.android.gms.gcm.Task
| ↳ | com.google.android.gms.gcm.OneoffTask

## Class Overview

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.

## Summary

Nested Classes
class | OneoffTask.Builder |

[Expand] Inherited Constants
From class com.google.android.gms.gcm.Task
int | EXTRAS_LIMIT_BYTES | The maximum size allowed for extras bundle in bytes.
int | NETWORK_STATE_ANY | Specify using `setRequiredNetwork(int)` that your task will execute regardless of whether a network is available.
int | NETWORK_STATE_CONNECTED | Specify using `setRequiredNetwork(int)` that your task will only execute if some sort of data connection is available - either metered or unmetered.
int | NETWORK_STATE_UNMETERED | Specify using `setRequiredNetwork(int)` that your task will only execute if there is an unmetered network connection available.
long | UNINITIALIZED |
From interface android.os.Parcelable
int | CONTENTS_FILE_DESCRIPTOR |
int | PARCELABLE_WRITE_RETURN_VALUE |

Fields
public static final Creator<OneoffTask> | CREATOR |

Public Methods
long | getWindowEnd()
long | getWindowStart()
void | toBundle(Bundle bundle) Insert the task object into the provided bundle for IPC.
String | toString()
void | writeToParcel(Parcel parcel, int flags)

[Expand] Inherited Methods
From class com.google.android.gms.gcm.Task
int | describeContents()
Bundle | getExtras()
int | getRequiredNetwork() If the specified network is unavailable, your task will not be run until it is.
boolean | getRequiresCharging() If the device is not charging and this is set to true, your task will not be run until it is.
String | getServiceName()
String | getTag()
boolean | isPersisted()
boolean | isUpdateCurrent()
void | writeToParcel(Parcel parcel, int i)
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface android.os.Parcelable
abstract int | describeContents()
abstract void | writeToParcel(Parcel arg0, int arg1)

## 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.

#### public String toString ()

#### public void writeToParcel (Parcel parcel, int flags)