# SearchCallbackDelegate

# SearchCallbackDelegate

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/SearchCallbackDelegate.java+class:androidx.car.app.model.SearchCallbackDelegate)  
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/SearchCallbackDelegate "View this page in Java")

<br />

```
@CarProtocol
interface SearchCallbackDelegate
```

<br />

*** ** * ** ***

A host-side delegate for sending[androidx.car.app.model.SearchTemplate.SearchCallback](https://developer.android.com/reference/kotlin/androidx/car/app/model/SearchTemplate.SearchCallback)events to the car app.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [sendSearchSubmitted](https://developer.android.com/reference/kotlin/androidx/car/app/model/SearchCallbackDelegate#sendSearchSubmitted(java.lang.String,androidx.car.app.OnDoneCallback))`(searchText: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)`)` Notifies that the user has submitted the search. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [sendSearchTextChanged](https://developer.android.com/reference/kotlin/androidx/car/app/model/SearchCallbackDelegate#sendSearchTextChanged(java.lang.String,androidx.car.app.OnDoneCallback))`(searchText: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, callback: `[OnDoneCallback](https://developer.android.com/reference/kotlin/androidx/car/app/OnDoneCallback)`)` Notifies that the search text has changed.   |

## Public functions

### sendSearchSubmitted

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

```
fun sendSearchSubmitted(searchText: String, callback: OnDoneCallback): Unit
```

Notifies that the user has submitted the search.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `searchText: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)              | the search text that was submitted                                                                                                                        |
| `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 |

### sendSearchTextChanged

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

```
fun sendSearchTextChanged(searchText: String, callback: OnDoneCallback): Unit
```

Notifies that the search text has changed.  

|                                                  Parameters                                                  |
|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `searchText: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)              | the up-to-date search text                                                                                                                                |
| `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 |