Stay organized with collections
Save and categorize content based on your preferences.
AdServicesOutcomeReceiver
public
interface
AdServicesOutcomeReceiver
This interface was deprecated
in API level 36.
use OutcomeReceiver
instead. Android R is no longer supported.
Callback interface intended for use when an asynchronous operation may result in a failure. Exact
copy of the OutcomeReceiver
class, re-defined in the AdServices package for
backwards compatibility to Android R.
This interface may be used in cases where an asynchronous API may complete either with a value
or with a Throwable
that indicates an error.
Summary
Public methods |
default
void
|
onError(E error)
Called when the asynchronous operation fails.
|
abstract
void
|
onResult(R result)
Called when the asynchronous operation succeeds and delivers a result value.
|
Public methods
onError
public void onError (E error)
Called when the asynchronous operation fails. The mode of failure is indicated by the Throwable
passed as an argument to this method.
Parameters |
error |
E : A subclass of Throwable with more details about the error that occurred.
This value cannot be null . |
onResult
public abstract void onResult (R result)
Called when the asynchronous operation succeeds and delivers a result value.
Parameters |
result |
R : The value delivered by the asynchronous operation. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-04-17 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 2025-04-17 UTC."],[],[],null,["# AdServicesOutcomeReceiver\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [Ad Services Extensions 10](/sdkExtensions) \nDeprecated in [API level\n36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nAdServicesOutcomeReceiver\n=========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/adservices/common/AdServicesOutcomeReceiver \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\ninterface\nAdServicesOutcomeReceiver\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------------------------------------------------------------------------------------|\n| android.adservices.common.AdServicesOutcomeReceiver\\\u003cR, E extends [java.lang.Throwable](/reference/java/lang/Throwable)\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This interface was deprecated\nin API level 36.** \n\nuse [OutcomeReceiver](/reference/android/os/OutcomeReceiver) instead. Android R is no longer supported.\n\nCallback interface intended for use when an asynchronous operation may result in a failure. Exact\ncopy of the [OutcomeReceiver](/reference/android/os/OutcomeReceiver) class, re-defined in the AdServices package for\nbackwards compatibility to Android R.\n\nThis interface may be used in cases where an asynchronous API may complete either with a value\nor with a [Throwable](/reference/java/lang/Throwable) that indicates an error.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` default void` | ` `[onError](/reference/android/adservices/common/AdServicesOutcomeReceiver#onError(E))`(E error) ` Called when the asynchronous operation fails. |\n| ` abstract void` | ` `[onResult](/reference/android/adservices/common/AdServicesOutcomeReceiver#onResult(R))`(R result) ` Called when the asynchronous operation succeeds and delivers a result value. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [Ad Services Extensions 10](/sdkExtensions) \nDeprecated in [API level\n36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onError (E error)\n```\n\nCalled when the asynchronous operation fails. The mode of failure is indicated by the [Throwable](/reference/java/lang/Throwable) passed as an argument to this method.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | `E`: A subclass of [Throwable](/reference/java/lang/Throwable) with more details about the error that occurred. This value cannot be `null`. \u003cbr /\u003e |\n\n### onResult\n\nAdded in [API level 35](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nAlso in [Ad Services Extensions 10](/sdkExtensions) \nDeprecated in [API level\n36](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onResult (R result)\n```\n\nCalled when the asynchronous operation succeeds and delivers a result value.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|----------------------------------------------------------------|\n| `result` | `R`: The value delivered by the asynchronous operation. \u003cbr /\u003e |"]]