the cause of your problem is the following error:
java.lang.IndexOutOfBoundsException: setSpan (4 ... 4) ends beyond length 0
Apparently you're setting a span on something, but the textfield is empty, giving an IndexOutOfBoundsException
, check the length of the input string before you make a call to setSpan.
EDIT:
Just a short clarification, an IndexOutOfBoundsException
always means you're trying to access part of an array that is beyond the actual length of the array. String objects are defined as arrays of characters. As such when you're trying to do something but the length of the string is equal to zero, you actually end up beyond the boundary of an array.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…