The cause of your problem is the following error: java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 0
Apparently you are setting the spacing to something, but the text field is empty, giving an IndexOutOfBoundsException
, check the length of the input string before making a call to setSpan.
EDIT:
Just a brief explanation, IndexOutOfBoundsException
always means that you are trying to access a part of the array that is outside the actual length of the array. String objects are defined as arrays of characters. Thus, when you try to do something, but the length of the string is zero, you actually find yourself outside the bounds of the array.
Segf4ult
source share