我正在使用下面的代码来改变我的应用程序语言按钮点击(例如从法语改为英语),它在
Android 4.0上工作正常,但在5.0上却没有.
Locale localeEn = new Locale("en_US");
Locale.setDefault(localeEn);
Configuration configEn = new Configuration();
configEn.locale = localeEn;
getApplicationContext().getResources().updateConfiguration(configEn, null);
this.recreate();
有什么线索为什么好吗?
编辑:
这是我的清单(用android:configChanges)
android:name=".activities.LoginActivity"
android:configChanges="orientation|locale"
android:label="@string/app_name"
android:screenOrientation="portrait"/>