Fix SpannableStringBuilder.replace() exception.
When SpannableStringBuilder.replace is called with a source text that contains a span with SPAN_PARAGRAPH flag, the code tries to retain the spans. However when the paragraph boundary constraint is not satisfied, setSpan method throws an exception. Updated the rule as: if the source text has a span with SPAN_PARAGRAPH flag check if it can be copied into the target. If not, discard the span. Also updated the JavaDoc for Spanned and Editable. Bug: 22521443 Change-Id: Ie8541e00bfdf5b8b0115ad7b26cb9f83a6a3ee55
Loading
Please register or sign in to comment