|
15 | 15 | import java.util.List; |
16 | 16 | import java.util.Locale; |
17 | 17 | import java.util.StringTokenizer; |
| 18 | +import java.util.TimerTask; |
18 | 19 |
|
19 | 20 | import org.json.JSONArray; |
20 | 21 | import org.torproject.android.service.OrbotConstants; |
|
92 | 93 | import com.google.zxing.integration.android.IntentIntegrator; |
93 | 94 | import com.google.zxing.integration.android.IntentResult; |
94 | 95 |
|
95 | | -import im.delight.android.languages.Language; |
96 | 96 | import pl.bclogic.pulsator4droid.library.PulsatorLayout; |
97 | 97 |
|
98 | 98 | import static android.support.v4.content.FileProvider.getUriForFile; |
@@ -938,12 +938,24 @@ protected void onActivityResult(int request, int response, Intent data) { |
938 | 938 | { |
939 | 939 | if (data != null && (!TextUtils.isEmpty(data.getStringExtra("locale")))) { |
940 | 940 |
|
941 | | - Prefs.setDefaultLocale(data.getStringExtra("locale")); |
942 | | - Languages.setLanguage(this, Prefs.getDefaultLocale(), true); |
943 | | - Language.setFromPreference(this, "pref_default_locale"); |
| 941 | + String newLocale = data.getStringExtra("locale"); |
| 942 | + Prefs.setDefaultLocale(newLocale); |
| 943 | + Languages.setLanguage(this, newLocale, true); |
| 944 | + // Language.setFromPreference(this, "pref_default_locale"); |
944 | 945 |
|
945 | 946 | finish(); |
946 | | - startActivity(new Intent(this,OrbotMainActivity.class)); |
| 947 | + |
| 948 | + final Handler handler = new Handler(); |
| 949 | + handler.postDelayed(new Runnable() { |
| 950 | + @Override |
| 951 | + public void run() { |
| 952 | + //Do something after 100ms |
| 953 | + startActivity(new Intent(OrbotMainActivity.this,OrbotMainActivity.class)); |
| 954 | + |
| 955 | + } |
| 956 | + }, 1000); |
| 957 | + |
| 958 | + |
947 | 959 | } |
948 | 960 | } |
949 | 961 | else if (request == REQUEST_VPN) |
|
0 commit comments