# Suggestion

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

*** ** * ** ***


```
@CarProtocol
public final class Suggestion
```

<br />

*** ** * ** ***

Suggestion that an application provide to an end user in order to be displayed by the host and allow then to interact with their application.

#### Examples

When a user opens their navigation app, it can post a suggestion as for the next place to drive to rather than wait for the user to enter or search for it.

## Summary

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion#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/Nullable.html https://developer.android.com/reference/android/app/PendingIntent.html` | `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion#getAction()()` Returns the `https://developer.android.com/reference/android/app/PendingIntent.html` of the suggestion. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarIcon` | `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion#getIcon()()` Returns a `CarIcon` to display with the suggestion or `null` if not set. |
| `@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/suggestion/model/Suggestion#getIdentifier()()` Returns the identifier of the suggestion. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion#getSubtitle()()` Returns the subtitle of the suggestion or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion#getTitle()()` Returns the title of the suggestion. |
| `int` | `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion#hashCode()()` |
| `@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/suggestion/model/Suggestion#toString()()` |

## Public methods

### equals

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

### getAction

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

```
public @Nullable PendingIntent getAction()
```

Returns the `https://developer.android.com/reference/android/app/PendingIntent.html` of the suggestion.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion.Builder#setAction(android.app.PendingIntent)` |   |

### getIcon

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

```
public @Nullable CarIcon getIcon()
```

Returns a `CarIcon` to display with the suggestion or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion.Builder#setIcon(androidx.car.app.model.CarIcon)` |   |

### getIdentifier

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

```
public @NonNull String getIdentifier()
```

Returns the identifier of the suggestion.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion.Builder#setIdentifier(java.lang.String)` |   |

### getSubtitle

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

```
public @Nullable CarText getSubtitle()
```

Returns the subtitle of the suggestion or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion.Builder#setSubtitle(java.lang.CharSequence)` |   |

### getTitle

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

```
public @NonNull CarText getTitle()
```

Returns the title of the suggestion.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/suggestion/model/Suggestion.Builder#setTitle(java.lang.CharSequence)` |   |

### hashCode

```
public int hashCode()
```

### toString

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