Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Qualifier and Type | Method Name and Description |
|---|---|
boolean | Checks whether a task is completed. The true value is returned if a task is completed; false otherwise. |
boolean | Checks whether a task is executed successfully. The true value is returned if a task is executed successfully; false otherwise. |
boolean | Checks whether a task is canceled. The true value is returned if a task is canceled; false otherwise. |
TResult | Obtains the execution result of a task if it is completed. |
<E extends Throwable> TResult | getResultThrowException(Class<E> exceptionClass) throws E Obtains the execution result of a task if it is completed. If an exception occurs and is specified by exceptionClass, the exception will be returned. |
Exception | Obtains the exception that causes the task execution failure. |
Task<TResult> | addOnSuccessListener(OnSuccessListener<TResult> listener) Adds one or more listeners that will be called in the main thread when a task is successfully executed. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnSuccessListener(Executor executor,OnSuccessListener<TResult> listener) Adds one or more listeners that will be called in a specified executor when a task is successfully executed. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnFailureListener(OnFailureListener listener) Adds one or more listeners that will be called in the main thread upon the task execution failure. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnFailureListener(Executor executor, OnFailureListener listener) Adds one or more listeners that will be called in a specified executor upon the task execution failure. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnCompleteListener(OnCompleteListener<TResult> listener) Adds one or more listeners that will be called in the main thread upon task completion. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnCompleteListener(Executor executor, OnCompleteListener<TResult> listener) Adds one or more listeners that will be called in a specified executor upon task completion. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnCanceledListener(Activity activity, OnCanceledListener listener) Adds one or more listeners that will be called in a specified executor upon task cancellation. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnCanceledListener(OnCanceledListener listener) Adds one or more listeners that will be called in the main thread upon task cancellation. Multiple listeners added will be called in the order in which they were added. |
Task<TResult> | addOnCanceledListener(Executor executor, OnCanceledListener listener) Adds one or more listeners that will be called in a specified executor upon task cancellation. Multiple listeners added will be called in the order in which they were added. |
<TContinuationResult> Task<TContinuationResult> | onSuccessTask(SuccessContinuation<TResult, TContinuationResult> listener) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in the main thread. If the current task is canceled, the new task is also canceled and the listener is not executed. If the current task fails to be executed, the failure handling will be performed and the listener will not be executed. |
<TContinuationResult> Task<TContinuationResult> | onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuationResult> listener) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in a specified executor. If the current task is canceled, the new task is also canceled and the listener is not executed. If the current task fails to be executed, the failure handling will be performed and the listener will not be executed. |
<TContinuationResult> Task<TContinuationResult> | continueWithTask(Continuation<TResult, Task<TContinuationResult>> taskContinuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in the main thread. If the current task is canceled, returned taskContinuation will still be executed. |
<TContinuationResult > Task<TContinuationResult> | continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> taskContinuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in a specified executor. If the current task is canceled, returned taskContinuation will still be executed. |
<TContinuationResult> Task<TContinuationResult> | continueWith(Continuation<TResult, TContinuationResult> taskContinuation) A then method to call the listener after Task is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in the main thread. If the current task is canceled, returned taskContinuation will not be executed. |
<TContinuationResult> Task<TContinuationResult> | continueWith( Executor executor, lContinuation<TResult, TContinuationResult> continuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in a specified executor. If the current task is canceled, returned taskContinuation will not be executed. |
Method |
|---|
public abstract boolean isComplete() Checks whether a task is completed. The true value is returned if a task is completed; false otherwise. |
Returns
Type | Description |
|---|---|
boolean | true if the task is completed; false otherwise. |
Method |
|---|
public abstract boolean isSuccessful() Checks whether a task is executed successfully. The true value is returned if a task is executed successfully; false otherwise. |
Returns
Type | Description |
|---|---|
boolean | true if the task is executed successfully; false otherwise. |
Method |
|---|
public abstract boolean isCanceled() Checks whether a task is canceled. The true value is returned if a task is canceled; false otherwise. |
Returns
Type | Description |
|---|---|
boolean | true if the task is canceled; false otherwise. |
Method |
|---|
public abstract TResult getResult() Obtains the execution result of a task if it is completed. |
Returns
Type | Description |
|---|---|
TResult | A task execution result. |
Method |
|---|
public abstract <E extends Throwable> TResult getResultThrowException(Class<E> exceptionClass) throws E Obtains the execution result of a task if it is completed. If an exception occurs and is specified by exceptionClass, the exception will be returned. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
exceptionClass | Class<E> | Y | Exception type. |
Throws
Name | Description |
|---|---|
Class<E> | If an exception is specified by exceptionClass. |
RuntimeException | If a task fails to be executed but an exception is not specified by exceptionClass. |
Returns
Type | Description |
|---|---|
TResult | A task execution result. |
Method |
|---|
public abstract Exception getException() Obtains the exception that causes the task execution failure. |
Returns
Type | Description |
|---|---|
Exception | An exception that causes the task execution failure. |
Method |
|---|
public abstract Task<TResult> addOnSuccessListener(OnSuccessListener<TResult> listener) Adds one or more listeners that will be called in the main thread when a task is successfully executed. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
listener | Y | Listener, which is called back when a task is executed successfully. |
Returns
Type | Description |
|---|---|
A task execution result. |
Method |
|---|
public abstract Task<TResult> addOnSuccessListener(Executor executor, OnSuccessListener<TResult> listener) Adds one or more listeners that will be called in a specified executor when a task is successfully executed. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor used for callback. |
listener | Y | Listener, which is called back when a task is executed successfully. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public abstract Task<TResult> addOnFailureListener(OnFailureListener listener) Adds one or more listeners that will be called in the main thread upon the task execution failure. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
listener | Y | Listener, which is called back when a task fails to be executed. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public abstract Task<TResult> addOnFailureListener(Executor executor, OnFailureListener listener) Adds one or more listeners that will be called in a specified executor upon the task execution failure. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor used for callback. |
listener | Y | Listener, which is called back when a task fails to be executed. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public Task<TResult> addOnCompleteListener(OnCompleteListener<TResult> listener) Adds one or more listeners that will be called in the main thread upon task completion. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
listener | Y | Listener, which is called back when a task is completed. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public Task<TResult> addOnCompleteListener(Executor executor, OnCompleteListener<TResult> listener) Adds one or more listeners that will be called in a specified executor upon task completion. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor used for callback. |
listener | Y | Listener, which is called back when a task is completed. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public Task<TResult> addOnCanceledListener(Activity activity, OnCanceledListener listener) Adds one or more listeners that will be called in a specified executor upon task cancellation. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
activity | Activity | Y | Activity context. |
listener | Y | Listener, which is called back when a task is canceled. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public Task<TResult> addOnCanceledListener(OnCanceledListener listener) Adds one or more listeners that will be called in the main thread upon task cancellation. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
listener | Y | Listener, which is called back when a task is canceled. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public Task<TResult> addOnCanceledListener(Executor executor, OnCanceledListener listener) Adds one or more listeners that will be called in a specified executor upon task cancellation. Multiple listeners added will be called in the order in which they were added. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor used for callback. |
listener | Y | Listener, which is called back when a task is canceled. |
Returns
Type | Description |
|---|---|
Task<TResult> | A task execution result. |
Method |
|---|
public <TContinuationResult> Task<TContinuationResult> onSuccessTask(SuccessContinuation< TResult, TContinuationResult> listener) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in the main thread. If the current task is canceled, the new task is also canceled and the listener is not executed. If the current task fails to be executed, the failure handling will be performed and the listener will not be executed. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
listener | Y | API implementation class instance, which implements the then API and is used to call a subsequent task after the current task is executed successfully. |
Returns
Type | Description |
|---|---|
Task<TContinuationResult> | A task subsequent to the current task. |
Method |
|---|
public <TContinuationResult> Task<TContinuationResult> onSuccessTask(Executor executor, SuccessContinuation<TResult, TContinuationResult> listener) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in a specified executor. If the current task is canceled, the new task is also canceled and the listener is not executed. If the current task fails to be executed, the failure handling will be performed and the listener will not be executed. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor used for callback. |
listener | SuccessContinuation<TResult, TContinuationResult> | Y | Listener, which is called back when a task is canceled. |
Returns
Type | Description |
|---|---|
Task<TContinuationResult> | A task subsequent to the current task. |
Method |
|---|
public <TContinuationResult> Task<TContinuationResult> continueWithTask(Continuation<TResult, Task<TContinuationResult>> taskContinuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in the main thread. If the current task is canceled, returned taskContinuation will still be executed. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
taskContinuation | Continuation<TResult, Task<TContinuationResult> | Y | API implementation class instance, which implements the then API and is used to call a subsequent task after the current task is executed successfully. |
Returns
Type | Description |
|---|---|
Task<TContinuationResult> | A task subsequent to the current task. |
Method |
|---|
public <TContinuationResult> Task<TContinuationResult> continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> taskContinuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in the main thread. If the current task is canceled, returned taskContinuation will still be executed. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor to execute taskContinuation. |
taskContinuation | Continuation<TResult, Task<TContinuationResult>> | Y | API implementation class instance, which implements the then API and is used to call a subsequent task after the current task is executed successfully. |
Returns
Type | Description |
|---|---|
Task<TContinuationResult> | A task subsequent to the current task. |
Method |
|---|
public <TContinuationResult> Task<TContinuationResult> continueWithTask(Executor executor, Continuation<TResult, Task<TContinuationResult>> taskContinuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in a specified executor. If the current task is canceled, returned taskContinuation will still be executed. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor to execute taskContinuation. |
taskContinuation | Continuation<TResult, Task<TContinuationResult>> | Y | API implementation class instance, which implements the then API and is used to call a subsequent task after the current task is executed successfully. |
Returns
Type | Description |
|---|---|
Task<TContinuationResult> | A task subsequent to the current task. |
Method |
|---|
public <TContinuationResult> Task<TContinuationResult> continueWith(Executor executor, Continuation<TResult, TContinuationResult> continuation) A then method to call the listener after Task<TResult> is successfully executed. The method returns Task<TContinuationResult> to create a Task<TContinuationResult> task based on the returned result. The listener is executed in a specified executor. If the current task is canceled, returned taskContinuation will not be executed. |
Parameters
Name | Type | Constraint | Description |
|---|---|---|---|
executor | Executor | Y | Executor to execute Continuation. |
taskContinuation | Continuation<TResult, TContinuationResult> | Y | API implementation class instance, which implements the then API and is used to call a subsequent task after the current task is executed successfully. |
Returns
Type | Description |
|---|---|
Task<TContinuationResult> | A task subsequent to the current task. |
Method |
|---|
public void destroy() Destroys PublisherAdView. This method needs to be called in onDestroy of the parent activity. No other methods should be called for PublisherAdView after destroy() is called. |