# SearchHeader

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

*** ** * ** ***


```
@CarProtocol
@ExperimentalCarApi
@RequiresCarApi(value = 9)
public final class SearchHeader
```

<br />

*** ** * ** ***

Represents a search bar header. This can be added to a `https://developer.android.com/reference/androidx/car/app/model/SectionedItemTemplate` to support search functionality.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/model/SearchHeader.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/model/SearchHeader`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/model/Action>` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#getEndHeaderActions()()` Returns the list of actions displayed at the end of the search header. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#getInitialSearchText()()` Returns the initial search text or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/SearchCallbackDelegate` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#getSearchCallbackDelegate()()` Returns the `https://developer.android.com/reference/androidx/car/app/model/SearchCallbackDelegate` for search callbacks. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#getSearchHint()()` Returns the search hint or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Action` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#getStartHeaderAction()()` Returns the action displayed at the start of the search header or `null` if not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#isShowKeyboardByDefault()()` Returns whether the keyboard should be displayed by default. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/SearchHeader#toString()()` |

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getEndHeaderActions

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

```
public @NonNull List<Action> getEndHeaderActions()
```

Returns the list of actions displayed at the end of the search header.

### getInitialSearchText

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

```
public @Nullable String getInitialSearchText()
```

Returns the initial search text or `null` if not set.

### getSearchCallbackDelegate

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

```
public @NonNull SearchCallbackDelegate getSearchCallbackDelegate()
```

Returns the `https://developer.android.com/reference/androidx/car/app/model/SearchCallbackDelegate` for search callbacks.

### getSearchHint

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

```
public @Nullable String getSearchHint()
```

Returns the search hint or `null` if not set.

### getStartHeaderAction

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

```
public @Nullable Action getStartHeaderAction()
```

Returns the action displayed at the start of the search header or `null` if not set.

### hashCode

```
public int hashCode()
```

### isShowKeyboardByDefault

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

```
public boolean isShowKeyboardByDefault()
```

Returns whether the keyboard should be displayed by default.

### toString

```
public @NonNull String toString()
```