Skip to content

IndexOutOfBoundsException when try use a keyboard gestures #183

Description

@wrozwad

Hello, first of all - thanks for great lib :)

Secondly - I use Fleksy keyboard that gives me a possibility to choose similar words after I press space, remove whole word via swipe back, and so on. Unfortunately when I try to use this gestures I receive this exception:

java.lang.IndexOutOfBoundsException: charAt: 6 >= length 6
    at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:114)
    at com.tokenautocomplete.TokenCompleteTextView$TokenTextWatcher.afterTextChanged(TokenCompleteTextView.java:1198)
    at android.widget.TextView.sendAfterTextChanged(TextView.java:7694)
    at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9492)
    at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:983)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:505)
    at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:215)
    at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:30)
    at android.view.inputmethod.BaseInputConnection.deleteSurroundingText(BaseInputConnection.java:245)
    at android.view.inputmethod.InputConnectionWrapper.deleteSurroundingText(InputConnectionWrapper.java:66)
    at com.tokenautocomplete.TokenCompleteTextView$TokenInputConnection.deleteSurroundingText(TokenCompleteTextView.java:1431)
    at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:382)
    at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)
    at android.os.Handler.dispatchMessage(Handler.java:110)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:5341)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:830)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:646)
    at dalvik.system.NativeStart.main(Native Method)
  • Android 4.4.2
  • Lib: 2.0.2
  • Fleksy keyboard

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions