# AlertCallbackDelegate

# AlertCallbackDelegate

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/model/AlertCallbackDelegate.java+class:androidx.car.app.model.AlertCallbackDelegate)  
Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.2.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/model/AlertCallbackDelegate "View this page in Java")

<br />

```
@CarProtocol
@RequiresCarApi(value = 5)
interface AlertCallbackDelegate
```

<br />

*** ** * ** ***

A host-side interface for reporting cancel events to clients.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [sendCancel](https://developer.android.com/reference/kotlin/androidx/car/app/model/AlertCallbackDelegate#sendCancel(int,androidx.car.app.OnDoneCallback))`(reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)`)` Notifies that a cancel event happened with given`reason`. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [sendDismiss](https://developer.android.com/reference/kotlin/androidx/car/app/model/AlertCallbackDelegate#sendDismiss(androidx.car.app.OnDoneCallback))`(callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)`)` Notifies that a dismiss event happened.                                                                                                            |

## Public functions

### sendCancel

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.2.0)  

```
fun sendCancel(reason: Int, callback: OnDoneCallback): Unit
```

Notifies that a cancel event happened with given`reason`.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `reason: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                        | the[AlertCallback.Reason](https://developer.android.com/reference/kotlin/androidx/car/app/model/AlertCallback.Reason)for which the alert was cancelled    |
| `callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback) | the[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)to trigger when the client finishes handling the event |

### sendDismiss

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.2.0)  

```
fun sendDismiss(callback: OnDoneCallback): Unit
```

Notifies that a dismiss event happened.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback) | the[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)to trigger when the client finishes handling the event |