Stay organized with collections
Save and categorize content based on your preferences.
ConnectionlessHandwritingCallback
interface ConnectionlessHandwritingCallback
Interface to receive the result of starting a connectionless stylus handwriting session using one of InputMethodManager.startConnectionlessStylusHandwriting(View, CursorAnchorInfo,
, android.view.inputmethod.InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,android.view.inputmethod.CursorAnchorInfo,java.util.concurrent.Executor,android.view.inputmethod.ConnectionlessHandwritingCallback)
, or android.view.inputmethod.InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,android.view.inputmethod.CursorAnchorInfo,java.lang.String,java.util.concurrent.Executor,android.view.inputmethod.ConnectionlessHandwritingCallback)
.
Summary
Constants |
static Int |
Error code indicating that the connectionless handwriting session started and completed but no text was recognized.
|
static Int |
Error code for any other reason that the connectionless handwriting session did not complete successfully.
|
static Int |
Error code indicating that the connectionless handwriting session was not started as the current IME does not support it.
|
Public methods |
abstract Unit |
Callback when the connectionless handwriting session did not complete successfully.
|
abstract Unit |
Callback when the connectionless handwriting session completed successfully and recognized text.
|
Constants
CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED
static val CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED: Int
Error code indicating that the connectionless handwriting session started and completed but no text was recognized.
Value: 0
CONNECTIONLESS_HANDWRITING_ERROR_OTHER
static val CONNECTIONLESS_HANDWRITING_ERROR_OTHER: Int
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.
Value: 2
CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED
static val CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED: Int
Error code indicating that the connectionless handwriting session was not started as the current IME does not support it.
Value: 1
Public methods
onError
abstract fun onError(errorCode: Int): Unit
Callback when the connectionless handwriting session did not complete successfully.
onResult
abstract fun onResult(text: CharSequence): Unit
Callback when the connectionless handwriting session completed successfully and recognized text.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ConnectionlessHandwritingCallback\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nConnectionlessHandwritingCallback\n=================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/inputmethod/ConnectionlessHandwritingCallback \"View this page in Java\") \n\n```\ninterface ConnectionlessHandwritingCallback\n```\n\n|-----------------------------------------------------------------|\n| [android.view.inputmethod.ConnectionlessHandwritingCallback](#) |\n\nInterface to receive the result of starting a connectionless stylus handwriting session using one of [InputMethodManager.startConnectionlessStylusHandwriting(View, CursorAnchorInfo,](/reference/kotlin/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwriting(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)), [android.view.inputmethod.InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,android.view.inputmethod.CursorAnchorInfo,java.util.concurrent.Executor,android.view.inputmethod.ConnectionlessHandwritingCallback)](/reference/kotlin/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)), or [android.view.inputmethod.InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,android.view.inputmethod.CursorAnchorInfo,java.lang.String,java.util.concurrent.Executor,android.view.inputmethod.ConnectionlessHandwritingCallback)](/reference/kotlin/android/view/inputmethod/InputMethodManager#startConnectionlessStylusHandwritingForDelegation(android.view.View,%20android.view.inputmethod.CursorAnchorInfo,%20kotlin.String,%20java.util.concurrent.Executor,%20android.view.inputmethod.ConnectionlessHandwritingCallback)).\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED](#CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED:kotlin.Int) Error code indicating that the connectionless handwriting session started and completed but no text was recognized. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONNECTIONLESS_HANDWRITING_ERROR_OTHER](#CONNECTIONLESS_HANDWRITING_ERROR_OTHER:kotlin.Int) Error code for any other reason that the connectionless handwriting session did not complete successfully. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED](#CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED:kotlin.Int) Error code indicating that the connectionless handwriting session was not started as the current IME does not support it. |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(kotlin.Int))`(`errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Callback when the connectionless handwriting session did not complete successfully. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onResult](#onResult(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`)` Callback when the connectionless handwriting session completed successfully and recognized text. |\n\nConstants\n---------\n\n### CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED: Int\n```\n\nError code indicating that the connectionless handwriting session started and completed but no text was recognized. \n\n Value: 0\n\n### CONNECTIONLESS_HANDWRITING_ERROR_OTHER\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CONNECTIONLESS_HANDWRITING_ERROR_OTHER: Int\n```\n\nError 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. \n\n Value: 2\n\n### CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED: Int\n```\n\nError code indicating that the connectionless handwriting session was not started as the current IME does not support it. \n\n Value: 1\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onError(errorCode: Int): Unit\n```\n\nCallback when the connectionless handwriting session did not complete successfully.\n\n| Parameters ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Value is [android.view.inputmethod.ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED](#CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED:kotlin.Int), [android.view.inputmethod.ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED](#CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED:kotlin.Int), or [android.view.inputmethod.ConnectionlessHandwritingCallback#CONNECTIONLESS_HANDWRITING_ERROR_OTHER](#CONNECTIONLESS_HANDWRITING_ERROR_OTHER:kotlin.Int) |\n\n### onResult\n\nAdded in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onResult(text: CharSequence): Unit\n```\n\nCallback when the connectionless handwriting session completed successfully and recognized text.\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------|\n| `text` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): This value cannot be `null`. |"]]