diff options
author | 2011-04-27 15:43:03 +0900 | |
---|---|---|
committer | 2011-04-27 16:11:34 +0900 | |
commit | 309bff562fbaf47488e6bf6636840f00574187d8 (patch) | |
tree | 05d2930c5a3583609541e1f9d1807c7c49510241 /java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java | |
parent | 663d4f5cc1b08b6daf168d8ac3dcd56127036516 (diff) | |
download | latinime-309bff562fbaf47488e6bf6636840f00574187d8.tar.gz latinime-309bff562fbaf47488e6bf6636840f00574187d8.tar.xz latinime-309bff562fbaf47488e6bf6636840f00574187d8.zip |
Add a method to set the locale to Utils.
Add a setLocale method to Utils that returns the previous locale.
Also unify all calls through the code.
Change-Id: Ic850dc5df19fba00ed3601835652859b4321b544
Diffstat (limited to 'java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java')
-rw-r--r-- | java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java index ce576d0cc..6678082b7 100644 --- a/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java +++ b/java/src/com/android/inputmethod/deprecated/languageswitcher/InputLanguageSelection.java @@ -29,7 +29,6 @@ import org.xmlpull.v1.XmlPullParserException; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; -import android.content.res.Configuration; import android.content.res.Resources; import android.os.Bundle; import android.preference.CheckBoxPreference; @@ -123,10 +122,7 @@ public class InputLanguageSelection extends PreferenceActivity { private Pair<Boolean, Boolean> hasDictionaryOrLayout(Locale locale) { if (locale == null) return new Pair<Boolean, Boolean>(false, false); final Resources res = getResources(); - final Configuration conf = res.getConfiguration(); - final Locale saveLocale = conf.locale; - conf.locale = locale; - res.updateConfiguration(conf, res.getDisplayMetrics()); + final Locale saveLocale = Utils.setSystemLocale(res, locale); boolean hasDictionary = false; boolean hasLayout = false; @@ -155,8 +151,7 @@ public class InputLanguageSelection extends PreferenceActivity { } catch (XmlPullParserException e) { } catch (IOException e) { } - conf.locale = saveLocale; - res.updateConfiguration(conf, res.getDisplayMetrics()); + Utils.setSystemLocale(res, saveLocale); return new Pair<Boolean, Boolean>(hasDictionary, hasLayout); } |