# 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)

*** ** * ** ***

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


```
@CarProtocol
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 |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion.Builder` A builder of `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://developer.android.com/reference/android/app/PendingIntent.html?` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#getAction()()` Returns the `https://developer.android.com/reference/android/app/PendingIntent.html` of the suggestion. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon?` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#getIcon()()` Returns a `CarIcon` to display with the suggestion or `null` if not set. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#getIdentifier()()` Returns the identifier of the suggestion. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText?` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#getSubtitle()()` Returns the subtitle of the suggestion or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#getTitle()()` Returns the title of the suggestion. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/suggestion/model/Suggestion#toString()()` |

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```

### getAction

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

```
fun getAction(): PendingIntent?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun getIcon(): CarIcon?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun getIdentifier(): String
```

Returns the identifier of the suggestion.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun getSubtitle(): CarText?
```

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
fun getTitle(): CarText
```

Returns the title of the suggestion.

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

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```