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

# TextAttribute.Builder

*** ** * ** ***


`
public
static
final

class
TextAttribute.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

Builder for creating a `https://developer.android.com/reference/android/view/inputmethod/TextAttribute`.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder#Builder()() ` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute` | ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder#build()() ` |
| ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder#setExtras(android.os.PersistableBundle)(https://developer.android.com/reference/android/os/PersistableBundle extras) ` Sets extras data. |
| ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder#setTextConversionSuggestions(java.util.List<java.lang.String>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String> textConversionSuggestions) ` Sets text conversion suggestions. |
| ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder` | ` https://developer.android.com/reference/android/view/inputmethod/TextAttribute.Builder#setTextSuggestionSelected(boolean)(boolean textSuggestionSelected) ` Sets whether a text conversion suggestion is currently being selected. |

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

```
public Builder ()
```

<br />

<br />

## Public methods

### build

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

```
public TextAttribute build ()
```

<br />

<br />

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

### setExtras

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

```
public TextAttribute.Builder setExtras (PersistableBundle extras)
```

Sets extras data.

Any extra data to supply to the applications. This field is for extended communication
with IME if there is data not defined in framework.

<br />

<br />

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

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

### setTextConversionSuggestions

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

```
public TextAttribute.Builder setTextConversionSuggestions (List<String> textConversionSuggestions)
```

Sets text conversion suggestions.

Text conversion suggestion is for some transliteration languages which has
pronunciation characters and target characters. When the user is typing the pronunciation
characters, the input method can insert possible target characters into this list so that
the editor authors can provide suggestion before the user enters the complete
pronunciation characters.

<br />

<br />

| Parameters ||
|---|---|
| `textConversionSuggestions` | `List`: The list of text conversion suggestions. This value cannot be `null`. <br /> |

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

### setTextSuggestionSelected

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

```
public TextAttribute.Builder setTextSuggestionSelected (boolean textSuggestionSelected)
```

Sets whether a text conversion suggestion is currently being selected.

In some transliteration languages, this describes the state which the user is
currently selecting a text conversion suggestion. In other words, if set to True the
user is in an ephemeral state of selecting which text will replace the current
composition text.

<br />

<br />

| Parameters ||
|---|---|
| `textSuggestionSelected` | `boolean`: Whether if the current text is undergoing text suggestion selection <br /> |

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