views:

50

answers:

1

I am trying to change the locale programmatically on Android. The code I have below works fine on the Incredible(2.2) and Droid(2.2). However, it doesn't on the DroidX(2.1 Update 1)

Anyone here have encountered similar problem ?? Any insight would be helpful.

public void overrideLocale(String languageToLoad) { 
 Locale locale = new Locale(languageToLoad);
 Locale.setDefault(locale);
 Configuration config = new Configuration();
 config.locale = locale; 

 getBaseContext().getResources().updateConfiguration(config, null);

 Intent intent = new Intent(this, ActivityB.class);
 intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
 startActivity(intent); 

}

A: 

This just don't work for Droid-X, very sad - it doesn't allow to change locale from inside the application.

Andrey Chorniy