전화기에 설정되어있는 것과 관계없이 체코 어 로케일을 사용하도록 로켈을 무시하려고합니다. 그러나 현재 로캘을 가져 오려고하면 체코를 반환하지만 복수형의 경우 실제 전화 로캘을 사용하는 것처럼 작동합니다. 응용 프로그램에서복수로 사용자 정의 로케일 사용
<application
android:name=".xxx"
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme.mystyle"
android:configChanges="locale"
>
: 여기
내 코드입니다String lang = settings.getString("cs", "");
locale = new Locale(lang);
Locale.setDefault(locale);
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
LocaleAssistant를 찾을 수 없습니다. – vandus
죄송합니다. 링크가 어떻게 든 부러졌습니다. 이제는 효과가있다. –
이런 뜻이야? 나는 틀린 일을해야만한다 :/ Configuration configuration = getBaseContext(). getResources(). getConfiguration(); configuration.locale = new 로켈 ("cs"); 로캘 지원 로캘 지원 = 새 LocaleAssistant(); localeAssistant.dispatchApplicationCreated (getBaseContext(). getResources()); localeAssistant.dispatchConfigurationChanged (configuration, getBaseContext(). getResources()); – vandus