java.lang.Object | |
↳ | com.google.android.gms.common.api.Batch |
Handles a batch of PendingResult
items. Callbacks can be added and you can block to wait for all
items in the batch to complete like any other PendingResult
item. A Batch can also be
canceled if the results are no longer needed. In this case, the onBatchComplete
callback
will never be triggered.
The results can be taken either from the underlying PendingResult
s or via
take(BatchResultToken)
but not both.
Nested Classes | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Batch.Builder |
Builder for Batch objects.
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mHandler |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Blocks until the task is completed.
| |||||||||||
Blocks until the task is completed or has timed out waiting for the result.
| |||||||||||
Requests that the batch be canceled.
| |||||||||||
Creates a result of type
that represents a failure with the specified
Status .
| |||||||||||
Forces the result of the API call a failure, unless a result has otherwise already been set.
| |||||||||||
Indicates whether the pending result has been canceled either due to calling
disconnect() or calling cancel() directly on the pending result
or an enclosing Batch .
| |||||||||||
Sets the result of the API call.
| |||||||||||
Set the callback here if you want the result to be delivered via a callback when the result
is ready or has timed out waiting for the result.
| |||||||||||
Set the callback here if you want the result to be delivered via a callback when the
result is ready.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when the result is returned by
await() or delivered via a
ResultCallback .
| |||||||||||
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||||||||||||||||||||||||
![]()
|
Blocks until the task is completed. This is not allowed on the UI thread. The returned
result object can have an additional failure mode of INTERRUPTED
.
Blocks until the task is completed or has timed out waiting for the result. This is not
allowed on the UI thread. The returned result object can have an additional failure mode of
either INTERRUPTED
or TIMEOUT
.
Requests that the batch be canceled. Cancels all underlying PendingResult
s.
onResult(Result)
will never be called, await()
will return
a failed result with status CANCELED
.
Creates a result of type
that represents a failure with the specified
Status
.
Forces the result of the API call a failure, unless a result has otherwise already been set.
Indicates whether the pending result has been canceled either due to calling
disconnect()
or calling cancel()
directly on the pending result
or an enclosing Batch
.
Sets the result of the API call. Assuming that a failure or cancelation has not already
been set, the result will be returned to the client via await()
or
onResult(R)
.
This method must called at most once.
Set the callback here if you want the result to be delivered via a callback when the result
is ready or has timed out waiting for the result. The returned result object can have an
additional failure mode of TIMEOUT
.
Set the callback here if you want the result to be delivered via a callback when the result is ready.
Called when the result is returned by await()
or delivered via a
ResultCallback
.