A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/android/reference/com/google/android/gms/tasks/SuccessContinuation below:

SuccessContinuation | Google Play services

Stay organized with collections Save and categorize content based on your preferences.

public interface SuccessContinuation<TResult, TContinuationResult>

A function that is called to continue execution then a Task succeeds.

Parameters <TResult>

the Task's result type

<TContinuationResult>

the Continuation's result type

Summary Public methods abstract @NonNull Task<TContinuationResult> then(TResult result)

Returns the result of applying this SuccessContinuation to Task.

Public methods
abstract @NonNull Task<TContinuationResult> then(TResult result)

Returns the result of applying this SuccessContinuation to Task.

The SuccessContinuation only happens then the Task is successful. If the previous Task fails, the onSuccessTask continuation will be skipped and failure listeners will be invoked.

  private Task<String> doSomething(String string) {
    // do something
  }
  task.onSuccessTask(new SuccessContinuation<String, String>() {
    @NonNull
    @Override
    public Task<String> then(String string) {
      return doSomething(string);
    }
  });
Parameters TResult result

the result of completed Task

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-10-31 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["`SuccessContinuation` is an interface defining a function for continuing execution when a `Task` succeeds."],["It allows chaining asynchronous operations, enabling the execution of further tasks upon the successful completion of a preceding task."],["If the previous `Task` fails, the `SuccessContinuation` is skipped, and failure listeners are triggered instead."],["The `then()` method within `SuccessContinuation` applies the continuation logic to the successful `Task` result and returns a new `Task` representing the outcome of the continuation."]]],["`SuccessContinuation` is an interface invoked when a `Task` succeeds. It defines the `then(TResult result)` method, which returns a new `Task` of type `TContinuationResult` based on the preceding `Task`'s successful result (`TResult`). This method only executes upon successful completion of the initial task; failure skips this and invokes failure listeners. It allows for chaining tasks where the result of one feeds into the next, enabling sequential operations on task success.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4