Code example for FragmentActivity

Methods: onConfigurationChanged

0
        updateInterfaceLanguage(); 
    } 
 
    @Override 
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        updateInterfaceLanguage(); 
    } 
 
    public void restartActivity(){ 
        startActivity(new Intent(this, this.getClass()));
        finish(); 
    } 
 
    private void updateInterfaceLanguage() { 
        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
        String localeSetting = settings.getString(AMPrefKeys.INTERFACE_LOCALE_KEY, "AUTO");
        Locale locale;
        /* Force to use the a language */ 
        if(localeSetting.equals("EN")){
            locale = Locale.US;