Stay organized with collections
Save and categorize content based on your preferences.
ConfirmationCallback
abstract class ConfirmationCallback
Callback class used when signaling that a prompt is no longer being presented.
Summary
Public methods |
open Unit |
Called when the requested prompt was dismissed by the application.
|
open Unit |
Called when the requested prompt was accepted by the user.
|
open Unit |
Called when the requested prompt was dismissed (not accepted) by the user.
|
open Unit |
Called when the requested prompt was dismissed because of a low-level error.
|
Public constructors
ConfirmationCallback
ConfirmationCallback()
Public methods
onCanceled
open fun onCanceled(): Unit
Called when the requested prompt was dismissed by the application.
onConfirmed
open fun onConfirmed(dataThatWasConfirmed: ByteArray): Unit
Called when the requested prompt was accepted by the user. The format of 'dataThatWasConfirmed' parameter is a CBOR encoded map (type 5) with (at least) the keys prompt and extra. The keys are encoded as CBOR text string (type 3). The value of promptText is encoded as CBOR text string (type 3), and the value of extraData is encoded as CBOR byte string (type 2). Other keys may be added in the future.
Parameters |
dataThatWasConfirmed |
ByteArray: the data that was confirmed, see above for the format. This value cannot be null . |
onDismissed
open fun onDismissed(): Unit
Called when the requested prompt was dismissed (not accepted) by the user.
onError
open fun onError(e: Throwable!): Unit
Called when the requested prompt was dismissed because of a low-level error.
Parameters |
e |
Throwable!: a throwable representing the error. |
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-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ConfirmationCallback\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nConfirmationCallback\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/security/ConfirmationCallback \"View this page in Java\") \n\n```\nabstract class ConfirmationCallback\n```\n\n|---|--------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.security.ConfirmationCallback](#) |\n\nCallback class used when signaling that a prompt is no longer being presented.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------|---|\n| [ConfirmationCallback](#ConfirmationCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCanceled](#onCanceled())`()` Called when the requested prompt was dismissed by the application. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onConfirmed](#onConfirmed(kotlin.ByteArray))`(`dataThatWasConfirmed:` `[ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html)`)` Called when the requested prompt was accepted by the user. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDismissed](#onDismissed())`()` Called when the requested prompt was dismissed (not accepted) by the user. |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(kotlin.Throwable))`(`e:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)!`)` Called when the requested prompt was dismissed because of a low-level error. |\n\nPublic constructors\n-------------------\n\n### ConfirmationCallback\n\n```\nConfirmationCallback()\n```\n\nPublic methods\n--------------\n\n### onCanceled\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onCanceled(): Unit\n```\n\nCalled when the requested prompt was dismissed by the application. \n\n### onConfirmed\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onConfirmed(dataThatWasConfirmed: ByteArray): Unit\n```\n\nCalled when the requested prompt was accepted by the user. The format of 'dataThatWasConfirmed' parameter is a [CBOR](http://cbor.io/) encoded map (type 5) with (at least) the keys **prompt** and **extra**. The keys are encoded as CBOR text string (type 3). The value of promptText is encoded as CBOR text string (type 3), and the value of extraData is encoded as CBOR byte string (type 2). Other keys may be added in the future.\n\n| Parameters ||\n|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `dataThatWasConfirmed` | [ByteArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte-array/index.html): the data that was confirmed, see above for the format. This value cannot be `null`. |\n\n### onDismissed\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onDismissed(): Unit\n```\n\nCalled when the requested prompt was dismissed (not accepted) by the user. \n\n### onError\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onError(e: Throwable!): Unit\n```\n\nCalled when the requested prompt was dismissed because of a low-level error.\n\n| Parameters ||\n|-----|------------------------------------------------------------------------------------------------------------------------------|\n| `e` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)!: a throwable representing the error. |"]]