# OnDoneCallback

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/OnDoneCallback.java+class:androidx.car.app.OnDoneCallback) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
interface OnDoneCallback
```

<br />

*** ** * ** ***

A host-side interface for handling success and failure scenarios on calls to the client.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback#onFailure(androidx.car.app.serialization.Bundleable)(response: https://developer.android.com/reference/kotlin/androidx/car/app/serialization/Bundleable)` Notifies that the request was not fulfilled successfully. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback#onSuccess(androidx.car.app.serialization.Bundleable)(response: https://developer.android.com/reference/kotlin/androidx/car/app/serialization/Bundleable?)` Notifies that the request has been successfully processed the request and provides a response. |

## Public functions

### onFailure

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

```
fun onFailure(response: Bundleable): Unit
```

Notifies that the request was not fulfilled successfully.

| Parameters |
|---|---|
| `response: https://developer.android.com/reference/kotlin/androidx/car/app/serialization/Bundleable` | the `https://developer.android.com/reference/kotlin/androidx/car/app/serialization/Bundleable` containing the failure response |

### onSuccess

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

```
fun onSuccess(response: Bundleable?): Unit
```

Notifies that the request has been successfully processed the request and provides a response.

| Parameters |
|---|---|
| `response: https://developer.android.com/reference/kotlin/androidx/car/app/serialization/Bundleable?` | the `https://developer.android.com/reference/kotlin/androidx/car/app/serialization/Bundleable` containing the success response |