How to localize an application so that it uses a specific locale no matter what language is installed on the device? I want users to be able to choose the language of their choice.
So far, I have this code in my Application class:
@Override public void onCreate() { //Set locale String l = Preferences.getLocale(getApplicationContext()); if (!l.equals("")) { Locale locale = new Locale(l); Locale.setDefault(locale); Configuration config = getBaseContext().getResources().getConfiguration(); config.locale = locale; getBaseContext().getResources().updateConfiguration( config, getBaseContext().getResources().getDisplayMetrics()); } LogData.InsertMessage(getApplicationContext(), "Application started"); }
The problem that I have is that it seems that I'm showing in set locale just fine (TextViews) But the subtitles and menu toasts will fall by default.
Is there any 1-2-3 on how to make it work correctly? I am using version 2.2
katit source share