Fix a bug with a duplicate entry
When going to the "all languages" dictionary and opening an
entry, the "all languages" entry would be listed twice.
Change-Id: Ie8cd7e9e824e95c05899b956905af6590b8929bc
diff --git a/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java b/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java
index d33f8c3..68b5c48 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryAddWordContents.java
@@ -184,7 +184,10 @@
// TODO: sort in unicode order
addLocaleDisplayNameToList(activity, localesList, l);
}
- localesList.add(new LocaleRenderer(activity, "")); // meaning: all languages
+ if (!"".equals(mLocale)) {
+ // If mLocale is "", then we already inserted the "all languages" item, so don't do it
+ addLocaleDisplayNameToList(activity, localesList, ""); // meaning: all languages
+ }
localesList.add(new LocaleRenderer(activity, null)); // meaning: select another locale
return localesList;
}