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

# TextBoundsInfoResult

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/view/inputmethod/TextBoundsInfoResult "View this page in Kotlin") \|Java


`
public

final

class
TextBoundsInfoResult
`


`

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


`

`


`

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

<br />

*** ** * ** ***

The object that holds the result of the
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` call.
**See also:**

- `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_CANCELLED` Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the request is cancelled. |
| `int` | `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_FAILED` Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the request failed. |
| `int` | `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS` Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the editor successfully returns a `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo`. |
| `int` | `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_UNSUPPORTED` Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the editor doesn't implement the method. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#TextBoundsInfoResult(int)(int resultCode) ` Create a `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult` object with no `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo`. |
| ` https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#TextBoundsInfoResult(int,%20android.view.inputmethod.TextBoundsInfo)(int resultCode, https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo textBoundsInfo) ` Create a `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult` object. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#getResultCode()() ` Return the result code of the `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` call. |
| ` https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo` | ` https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#getTextBoundsInfo()() ` Return the `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo` provided by the editor. |

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

## Constants

### CODE_CANCELLED

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

```
public static final int CODE_CANCELLED
```

Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the
request is cancelled. This happens when the `https://developer.android.com/reference/android/view/inputmethod/InputConnection` is or becomes
invalidated while requesting the
`https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo`, for example because a new `InputConnection` was started, or
due to `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#invalidateInput(android.view.View)`.

<br />

Constant Value:

3
(0x00000003)


### CODE_FAILED

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

```
public static final int CODE_FAILED
```

Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the
request failed. This result code is returned when the editor can't provide a valid
`https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo`. (e.g. The editor view is not laid out.)

<br />

Constant Value:

2
(0x00000002)


### CODE_SUCCESS

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

```
public static final int CODE_SUCCESS
```

Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the
editor successfully returns a `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo`.

<br />

Constant Value:

1
(0x00000001)


### CODE_UNSUPPORTED

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

```
public static final int CODE_UNSUPPORTED
```

Result for `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` when the
editor doesn't implement the method.

<br />

Constant Value:

0
(0x00000000)


## Public constructors

### TextBoundsInfoResult

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

```
public TextBoundsInfoResult (int resultCode)
```

Create a `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult` object with no `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo`.
The given `resultCode` can't be `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS`.

<br />

| Parameters ||
|---|---|
| `resultCode` | `int`: the result code of the `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` call. Value is one of the following: - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_UNSUPPORTED` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_FAILED` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_CANCELLED` |

### TextBoundsInfoResult

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

```
public TextBoundsInfoResult (int resultCode, 
                TextBoundsInfo textBoundsInfo)
```

Create a `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult` object.

<br />

| Parameters ||
|---|---|
| `resultCode` | `int`: the result code of the `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` call. Value is one of the following: - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_UNSUPPORTED` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_FAILED` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_CANCELLED` |
| `textBoundsInfo` | `TextBoundsInfo`: the returned `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo` of the `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` call. It can't be null if the `resultCode` is `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | if the resultCode is `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS` but the given `textBoundsInfo` is null. |

## Public methods

### getResultCode

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

```
public int getResultCode ()
```

Return the result code of the
`https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)` call.
Its value is one of the `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_UNSUPPORTED`, `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS`,
`https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_FAILED` and `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_CANCELLED`.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_UNSUPPORTED` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_FAILED` - `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_CANCELLED` |

### getTextBoundsInfo

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

```
public TextBoundsInfo getTextBoundsInfo ()
```

Return the `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo` provided by the editor. It is non-null if the
`resultCode` is `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfoResult#CODE_SUCCESS`.
Otherwise, it can be null in the following conditions:

- the editor doesn't support `https://developer.android.com/reference/android/view/inputmethod/InputConnection#requestTextBoundsInfo(android.graphics.RectF,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.view.inputmethod.TextBoundsInfoResult>)`.
- the editor doesn't have the text bounds information at the moment. (e.g. the editor view is not laid out yet.)
- the `https://developer.android.com/reference/android/view/inputmethod/InputConnection` is or become inactive during the request.

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/inputmethod/TextBoundsInfo` | <br /> |