Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#inhmethods)

# InlineSuggestionsRequest.Builder

*** ** * ** ***

` public static final class InlineSuggestionsRequest.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.inputmethod.InlineSuggestionsRequest.Builder |

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#Builder(java.util.List<android.widget.inline.InlinePresentationSpec>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec> inlinePresentationSpecs) ` Creates a new Builder. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#addInlinePresentationSpecs(android.widget.inline.InlinePresentationSpec)(https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec value) ` |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#build()() ` Builds the instance. |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#setExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle value) ` The extras state propagated from the IME to pass extra data. |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec> value) ` The `https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec` for each suggestion in the response. |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#setInlineTooltipPresentationSpec(android.widget.inline.InlinePresentationSpec)(https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec value) ` Specifies the UI specification for the inline suggestion tooltip in the response. |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#setMaxSuggestionCount(int)(int value) ` Max number of suggestions expected from the response. |
| ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#setSupportedLocales(android.os.LocaleList)(https://developer.android.com/reference/android/os/LocaleList value) ` The IME provided locales for the request. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Builder

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (List<InlinePresentationSpec> inlinePresentationSpecs)
```

Creates a new Builder.

<br />

| Parameters ||
|---|---|
| `inlinePresentationSpecs` | `List`: The `https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec` for each suggestion in the response. If the max suggestion count is larger than the number of specs in the list, then the last spec is used for the remainder of the suggestions. The list should not be empty. This value cannot be `null`. <br /> |

## Public methods

### addInlinePresentationSpecs

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest.Builder addInlinePresentationSpecs (InlinePresentationSpec value)
```

<br />

<br />

| Parameters ||
|---|---|
| `value` | `InlinePresentationSpec`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder#setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)`

### build

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest build ()
```

Builds the instance. This builder should not be touched after calling this!

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest` | This value cannot be `null`. <br /> |

### setExtras

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest.Builder setExtras (Bundle value)
```

The extras state propagated from the IME to pass extra data.

Note: There should be no remote objects in the bundle, all included remote objects will be removed from the bundle before transmission.

<br />

<br />

| Parameters ||
|---|---|
| `value` | `Bundle`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | This value cannot be `null`. <br /> |

### setInlinePresentationSpecs

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest.Builder setInlinePresentationSpecs (List<InlinePresentationSpec> value)
```

The `https://developer.android.com/reference/android/widget/inline/InlinePresentationSpec` for each suggestion in the response. If the max suggestion count is larger than the number of specs in the list, then the last spec is used for the remainder of the suggestions. The list should not be empty.

<br />

| Parameters ||
|---|---|
| `value` | `List`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | This value cannot be `null`. <br /> |

### setInlineTooltipPresentationSpec

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest.Builder setInlineTooltipPresentationSpec (InlinePresentationSpec value)
```

Specifies the UI specification for the inline suggestion tooltip in the response.

<br />

| Parameters ||
|---|---|
| `value` | `InlinePresentationSpec`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | This value cannot be `null`. <br /> |

### setMaxSuggestionCount

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest.Builder setMaxSuggestionCount (int value)
```

Max number of suggestions expected from the response. It must be a positive value. Defaults to `SUGGESTION_COUNT_UNLIMITED` if not set.

In practice, it is recommended that the max suggestion count does not exceed **5** for performance reasons.

<br />

<br />

| Parameters ||
|---|---|
| `value` | `int` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | This value cannot be `null`. <br /> |

### setSupportedLocales

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public InlineSuggestionsRequest.Builder setSupportedLocales (LocaleList value)
```

The IME provided locales for the request. If non-empty, the inline suggestions should return languages from the supported locales. If not provided, it'll default to be empty if target SDK is S or above, and default to system locale otherwise.

Note for Autofill Providers: It is **recommended** for the returned inline suggestions to have one locale to guarantee consistent UI rendering.

<br />

<br />

| Parameters ||
|---|---|
| `value` | `LocaleList`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/InlineSuggestionsRequest.Builder` | This value cannot be `null`. <br /> |