You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And my EditText has another TextWatcher in order to format its text.
When I type the first character in the EditText, it throws an IndexOutOfBoundsException: Invalid index 2, size is 2.
I figured out that my TextWatcher is making the textChanges' observable emit 2 events.
The first disposes the observable and it unregisters the textChanges listener. And when the second is triggered it throws the exception, since the listener isn't anymore in the EditText's arraylist.
The text was updated successfully, but these errors were encountered:
I ain't doing anything in a different thread, so by default it still unregister in the main thread. Anyway, I tried to add unsubscribeOn(mainThread()) as you said, but still happen.
As it's a platform bug, I'll think in a different workaround. Thanks though :)
Hi everyone.
I have a code like:
And my EditText has another
TextWatcher
in order to format its text.When I type the first character in the EditText, it throws an
IndexOutOfBoundsException: Invalid index 2, size is 2
.I figured out that my
TextWatcher
is making the textChanges' observable emit 2 events.The first disposes the observable and it unregisters the textChanges listener. And when the second is triggered it throws the exception, since the listener isn't anymore in the EditText's arraylist.
The text was updated successfully, but these errors were encountered: