Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException when try use a keyboard gestures #183

Closed
wrozwad opened this issue Dec 8, 2015 · 2 comments
Closed

IndexOutOfBoundsException when try use a keyboard gestures #183

wrozwad opened this issue Dec 8, 2015 · 2 comments

Comments

@wrozwad
Copy link

wrozwad commented Dec 8, 2015

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
@msisinni
Copy link

I haven't narrowed this down to Fleksy or anything, but I do have an updated stack trace for this crash on library version 2.0.7. This particular crash happened on Android 4.4.4, but I also have stack traces for 5 and 6 on a range of devices.

Fatal Exception: java.lang.IndexOutOfBoundsException: charAt: 48 >= length 48
   at android.text.SpannableStringBuilder.charAt(SpannableStringBuilder.java:114)
   at com.tokenautocomplete.TokenCompleteTextView$TokenTextWatcher.afterTextChanged(TokenCompleteTextView.java:1319)
   at android.widget.TextView.sendAfterTextChanged(TextView.java:7842)
   at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:10077)
   at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:982)
   at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:509)
   at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:212)
   at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:30)
   at android.view.inputmethod.BaseInputConnection.deleteSurroundingText(BaseInputConnection.java:257)
   at android.view.inputmethod.InputConnectionWrapper.deleteSurroundingText(InputConnectionWrapper.java:76)
   at com.tokenautocomplete.TokenCompleteTextView$TokenInputConnection.deleteSurroundingText(TokenCompleteTextView.java:1555)
   at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:451)
   at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:95)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:157)
   at android.app.ActivityThread.main(ActivityThread.java:5633)
   at java.lang.reflect.Method.invokeNative(Method.java)
   at java.lang.reflect.Method.invoke(Method.java:515)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
   at dalvik.system.NativeStart.main(NativeStart.java)

@mgod
Copy link
Contributor

mgod commented Mar 9, 2019

This should be resolved in 3.0.0

@mgod mgod closed this as completed Mar 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants