Android 如何在OnConfiguration Changed()中识别区域设置更改和方向更改
我正在使一个应用程序多语言和处理方向,以及我想注销用户,如果语言环境发生变化,我实现了这一点,但现在当用户改变方向,然后它将注销用户Android 如何在OnConfiguration Changed()中识别区域设置更改和方向更改,android,orientation,locale,multilingual,Android,Orientation,Locale,Multilingual,我正在使一个应用程序多语言和处理方向,以及我想注销用户,如果语言环境发生变化,我实现了这一点,但现在当用户改变方向,然后它将注销用户 @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); boolean deviceLanguageOverridenWithDefaultLanguage = Persist
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
boolean deviceLanguageOverridenWithDefaultLanguage = PersistentManager.isDeviceLanguageOverridenWithDefaultLanguage();
if(deviceLanguageOverridenWithDefaultLanguage)
{
AppUtil.setApplicationLanguage(AppConstants.APPLICATION_DEFAULT_LANGUAGE);
}
if(AppUtil.isSupportedLanguage(newConfig.locale))
{
UIUtil.showLogoutAlertDialog(this, getString(R.string.dialog_log_out_message_change_language_log_out), getString(R.string.dialog_log_out_title_log_out), false);
}
}