From 8023d16ce8ca9ca53858cc860c80437720b1cf76 Mon Sep 17 00:00:00 2001 From: n8fr8 Date: Thu, 7 Feb 2013 15:24:01 +0700 Subject: [PATCH] updated locale handling to stop flashing --- AndroidManifest.xml | 9 +++++---- src/org/torproject/android/OrbotApp.java | 15 +++++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0fa75da7..2df28d56 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,22 +1,23 @@ - + + - + diff --git a/src/org/torproject/android/OrbotApp.java b/src/org/torproject/android/OrbotApp.java index 66a1e9ae..d470afb1 100644 --- a/src/org/torproject/android/OrbotApp.java +++ b/src/org/torproject/android/OrbotApp.java @@ -35,10 +35,14 @@ public class OrbotApp extends Application implements TorConstants locale = new Locale(lang); Locale.setDefault(locale); - config.locale = locale; - getResources().updateConfiguration(config, getResources().getDisplayMetrics()); + + Configuration myConfig = new Configuration(config); + myConfig.locale = locale; + + getResources().updateConfiguration(myConfig, getResources().getDisplayMetrics()); } + } @Override @@ -51,9 +55,12 @@ public class OrbotApp extends Application implements TorConstants if (! "".equals(lang) && ! newConfig.locale.getLanguage().equals(lang)) { locale = new Locale(lang); - newConfig.locale = locale; Locale.setDefault(locale); - getResources().updateConfiguration(newConfig, getResources().getDisplayMetrics()); + + Configuration myConfig = new Configuration(newConfig); + myConfig.locale = locale; + + getResources().updateConfiguration(myConfig, getResources().getDisplayMetrics()); } } }