edittext-mask
edittext-mask copied to clipboard
Clear text causes java.lang.IndexOutOfBoundsException
I want to clear field when incorrect digit typed (two-digit month field for credit card)
When invoking monthCard.getText().clear();
there are such error:
FATAL EXCEPTION: main Process: ru.perekrestok.app, PID: 28172 java.lang.IndexOutOfBoundsException: setSpan (1 ... 1) ends beyond length 0 at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1309) at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:680) at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:672) at android.text.Selection.setSelection(Selection.java:76) at android.text.Selection.setSelection(Selection.java:87) at android.widget.EditText.setSelection(EditText.java:127) at br.com.sapereaude.maskedEditText.MaskedEditText.afterTextChanged(MaskedEditText.java:303)
Anything new about this one?
Happens to me as well with a simple EditText object, only workaround that I found was to call .setText("")
For a numberPassword
EditText field
Hello, yes, will need to investigate. If you can help me with that - it would be nice, and I'll provide you all the info about how to build the source code, upload changes, test/debug and so on! Please, reach me out, if you're interested!