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

# ConnectionlessHandwritingCallback

*** ** * ** ***


`
public


interface
ConnectionlessHandwritingCallback
`


`


`

|---|
| android.view.inputmethod.ConnectionlessHandwritingCallback |

<br />

*** ** * ** ***

Interface to receive the result of starting a connectionless stylus handwriting session using
one of `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwriting(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`, `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`, or `https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.lang.String,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)`.

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED` Error code indicating that the connectionless handwriting session started and completed but no text was recognized. |
| `int` | `https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_OTHER` Error code for any other reason that the connectionless handwriting session did not complete successfully. |
| `int` | `https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED` Error code indicating that the connectionless handwriting session was not started as the current IME does not support it. |

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#onError(int)(int errorCode) ` Callback when the connectionless handwriting session did not complete successfully. |
| ` abstract void` | ` https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#onResult(java.lang.CharSequence)(https://developer.android.com/reference/java/lang/CharSequence text) ` Callback when the connectionless handwriting session completed successfully and recognized text. |

## Constants

### CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED

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

```
public static final int CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED
```

Error code indicating that the connectionless handwriting session started and completed
but no text was recognized.

<br />

Constant Value:

0
(0x00000000)


### CONNECTIONLESS_HANDWRITING_ERROR_OTHER

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

```
public static final int CONNECTIONLESS_HANDWRITING_ERROR_OTHER
```

Error code for any other reason that the connectionless handwriting session did not complete
successfully. Either the session could not start, or the session started but did not complete
successfully.

<br />

Constant Value:

2
(0x00000002)


### CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED

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

```
public static final int CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED
```

Error code indicating that the connectionless handwriting session was not started as the
current IME does not support it.

<br />

Constant Value:

1
(0x00000001)


## Public methods

### onError

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

```
public abstract void onError (int errorCode)
```

Callback when the connectionless handwriting session did not complete successfully.

<br />

| Parameters ||
|---|---|
| `errorCode` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED` - `https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED` - `https://developer.android.com/reference/android/view/inputmethod/ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_OTHER` |

### onResult

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

```
public abstract void onResult (CharSequence text)
```

Callback when the connectionless handwriting session completed successfully and
recognized text.

<br />

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