Create method which sets your basic Locale.Lets say
public static void setDefaultLocale(Context context,String locale) {
Locale locJa = new Locale(locale);
Locale.setDefault(locJa);
Configuration config = new Configuration();
config.locale = locJa;
context.getResources().updateConfiguration(config, context.getResources()
.getDisplayMetrics());
locJa = null;
config = null;
}
Now check when user selected Locale.(Here basically I have used menu for language selection).
Configuration config = new Configuration();
String newLocale = config.locale.getLanguage().substring(0, 2)
.toLowerCase();
if ("ja".equalsIgnoreCase(newLocale)) {
// Call above method with context & newLocale
}
// Sequentially you check for Locale & change that.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…