Skip to content

Commit 76bb11c

Browse files
Gilles DebunneAndroid (Google) Code Review
authored andcommitted
Merge "Bug 5575396: close spell session on language change" into ics-mr1
2 parents 630a13b + 8b67db1 commit 76bb11c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/java/android/widget/SpellChecker.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ public SpellChecker(TextView textView) {
8282
}
8383

8484
private void setLocale(Locale locale) {
85+
closeSession();
86+
8587
final TextServicesManager textServicesManager = (TextServicesManager)
8688
mTextView.getContext().getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
8789
if (!textServicesManager.isSpellCheckerEnabled()) {
@@ -104,12 +106,6 @@ private void setLocale(Locale locale) {
104106
// Change SpellParsers' wordIterator locale
105107
mWordIterator = new WordIterator(locale);
106108

107-
// Stop all SpellParsers
108-
final int length = mSpellParsers.length;
109-
for (int i = 0; i < length; i++) {
110-
mSpellParsers[i].finish();
111-
}
112-
113109
// Remove existing misspelled SuggestionSpans
114110
mTextView.removeMisspelledSpans((Editable) mTextView.getText());
115111

0 commit comments

Comments
 (0)