public static void fixLocale(Context context){
  final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(context);
  String language=prefs.getString(Global.PREF_KEY_USER_LOCALE,"");
  Locale locale=Global.systemLocale;
  if ((language != null) && (!language.isEmpty())) {
    locale=new Locale(language);
  }
  if (locale != null) {
    Locale.setDefault(locale);
    Configuration config=new Configuration();
    config.locale=locale;
    Resources resources=context.getResources();
    resources.updateConfiguration(config,resources.getDisplayMetrics());
    if (context instanceof LocalizedActivity) {
      ((LocalizedActivity)context).myLocale=locale;
    }
  }
}

public static void fixLocale ( Context context ) { final SharedPreferences prefs = PreferenceManager . getDefaultSharedPreferences ( context ) ; String language = prefs . getString ( Global . PREF_KEY_USER_LOCALE , "" ) ; Locale locale = Global . systemLocale ; if ( ( language != null ) && ( ! language . isEmpty ( ) ) ) { locale = new Locale ( language ) ; } if ( locale != null ) { Locale . setDefault ( locale ) ; Configuration config = new Configuration ( ) ; config . locale = locale ; Resources resources = context . getResources ( ) ; resources . updateConfiguration ( config , resources . getDisplayMetrics ( ) ) ; if ( context instanceof LocalizedActivity ) { ( ( LocalizedActivity ) context ) . myLocale = locale ; } } }
set activity - s locale to sharedpreferences - setting . must be called before
