Stay organized with collections
Save and categorize content based on your preferences.
AdServicesOutcomeReceiver
interface AdServicesOutcomeReceiver<R : Any!, E : Throwable!>
Callback interface intended for use when an asynchronous operation may result in a failure. Exact copy of the android.os.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 |
open Unit |
Called when the asynchronous operation fails.
|
abstract Unit |
Called when the asynchronous operation succeeds and delivers a result value.
|
Public methods
onError
open fun onError(error: E): Unit
Deprecated: Deprecated in Java.
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
abstract fun onResult(result: R): Unit
Deprecated: Deprecated in Java.
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \nDeprecated in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAdServicesOutcomeReceiver\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/common/AdServicesOutcomeReceiver \"View this page in Java\") \n\n```\ninterface AdServicesOutcomeReceiver\u003cR : Any!, E : Throwable!\u003e\n```\n\n|----------------------------------------------------------|\n| [android.adservices.common.AdServicesOutcomeReceiver](#) |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 36.**\n|\n| use [android.os.OutcomeReceiver](../../os/OutcomeReceiver.html#) instead. Android R is no longer supported.\n\nCallback interface intended for use when an asynchronous operation may result in a failure. Exact copy of the [android.os.OutcomeReceiver](../../os/OutcomeReceiver.html#) class, re-defined in the AdServices package for backwards compatibility to Android R.\n\nThis interface may be used in cases where an asynchronous API may complete either with a value or with a [Throwable](../../../java/lang/Throwable.html#) that indicates an error.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(android.adservices.common.AdServicesOutcomeReceiver.E))`(`error:` `E`)` Called when the asynchronous operation fails. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResult](#onResult(android.adservices.common.AdServicesOutcomeReceiver.R))`(`result:` `R`)` Called when the asynchronous operation succeeds and delivers a result value. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \nDeprecated in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onError(error: E): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCalled when the asynchronous operation fails. The mode of failure is indicated by the [Throwable](../../../java/lang/Throwable.html#) passed as an argument to this method.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| `error` | E: A subclass of [Throwable](../../../java/lang/Throwable.html#) with more details about the error that occurred. This value cannot be `null`. |\n\n### onResult\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 10](https://developer.android.com/sdkExtensions) \nDeprecated in [API level 36](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onResult(result: R): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCalled when the asynchronous operation succeeds and delivers a result value.\n\n| Parameters ||\n|----------|-------------------------------------------------------|\n| `result` | R: The value delivered by the asynchronous operation. |"]]