Code example for FragmentActivity

Methods: finish, startActivity

0
        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;
        } else if (localeSetting.equals("SC")){
            locale = Locale.SIMPLIFIED_CHINESE;
        } else if (localeSetting.equals("TC")){
            locale = Locale.TRADITIONAL_CHINESE;
        } else if (localeSetting.equals("CS")){