Loading core/java/android/widget/TextView.java +2 −13 Original line number Original line Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.text.Selection; import android.text.SpanWatcher; import android.text.SpanWatcher; import android.text.Spannable; import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.Spanned; import android.text.SpannedString; import android.text.SpannedString; import android.text.StaticLayout; import android.text.StaticLayout; Loading Loading @@ -3494,19 +3495,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener ss.selEnd = end; ss.selEnd = end; if (mText instanceof Spanned) { if (mText instanceof Spanned) { /* Spannable sp = new SpannableStringBuilder(mText); * Calling setText() strips off any ChangeWatchers; * strip them now to avoid leaking references. * But do it to a copy so that if there are any * further changes to the text of this view, it * won't get into an inconsistent state. */ Spannable sp = new SpannableString(mText); for (ChangeWatcher cw : sp.getSpans(0, sp.length(), ChangeWatcher.class)) { sp.removeSpan(cw); } if (mEditor != null) { if (mEditor != null) { removeMisspelledSpans(sp); removeMisspelledSpans(sp); Loading Loading
core/java/android/widget/TextView.java +2 −13 Original line number Original line Diff line number Diff line Loading @@ -56,6 +56,7 @@ import android.text.Selection; import android.text.SpanWatcher; import android.text.SpanWatcher; import android.text.Spannable; import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.Spanned; import android.text.SpannedString; import android.text.SpannedString; import android.text.StaticLayout; import android.text.StaticLayout; Loading Loading @@ -3494,19 +3495,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener ss.selEnd = end; ss.selEnd = end; if (mText instanceof Spanned) { if (mText instanceof Spanned) { /* Spannable sp = new SpannableStringBuilder(mText); * Calling setText() strips off any ChangeWatchers; * strip them now to avoid leaking references. * But do it to a copy so that if there are any * further changes to the text of this view, it * won't get into an inconsistent state. */ Spannable sp = new SpannableString(mText); for (ChangeWatcher cw : sp.getSpans(0, sp.length(), ChangeWatcher.class)) { sp.removeSpan(cw); } if (mEditor != null) { if (mEditor != null) { removeMisspelledSpans(sp); removeMisspelledSpans(sp); Loading