diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index a822a1dd9a58e..150b4072b3153 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -2793,6 +2793,8 @@ public class Editor { // The suggestions are sorted according to their types (easy correction first, then // misspelled) and to the length of the text that they cover (shorter first). Arrays.sort(suggestionSpans, mSuggestionSpanComparator); + mSpansLengths.clear(); + return suggestionSpans; }