# OnClickDelegate

# OnClickDelegate

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

*** ** * ** ***

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

<br />

```
@CarProtocol
interface OnClickDelegate
```

<br />

*** ** * ** ***

A host-side interface for reporting click to clients.

## Summary

|                                ### Public functions                                 |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isParkedOnly](https://developer.android.com/reference/kotlin/androidx/car/app/model/OnClickDelegate#isParkedOnly())`()` Indicates if the click listener is for parked-only scenarios.                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [sendClick](https://developer.android.com/reference/kotlin/androidx/car/app/model/OnClickDelegate#sendClick(androidx.car.app.OnDoneCallback))`(callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)`)` Notifies that a click happened. |

## Public functions

### isParkedOnly

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

```
fun isParkedOnly(): Boolean
```

Indicates if the click listener is for parked-only scenarios.  

### sendClick

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

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

Notifies that a click 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 |