问题描述
语言可以更改
主页 > 菜单 > 设置 > 区域设置 &文本 > 选择语言环境
Home > Menu > Settings > Locale & text > Select locale
我想知道如何检测这种变化?在这样的操作过程中,我的应用程序似乎被系统关闭了,但我必须 100% 确定,这是官方规定.
I am wondering how can I detect such change? My application is seems to be turned off by system during such operation, however I have to be 100% sure, that this is official rule.
你知道吗?
推荐答案
http://developer.android.com/guide/topics/manifest/activity-element.html#config 说:
android:configChanges列出活动将自行处理的配置更改.当运行时发生配置更改时,默认情况下会关闭并重新启动 Activity,但使用此属性声明配置会阻止 Activity 重新启动.相反,活动保持运行并调用其 onConfigurationChanged() 方法.
注意:应避免使用此属性,仅将其用作最后的手段.有关如何正确处理由于配置更改而重新启动的更多信息,请阅读处理运行时更改.
Note: Using this attribute should be avoided and used only as a last-resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.
以下任何或所有字符串都是此属性的有效值.多个值用|"分隔— 例如,locale|navigation|orientation".
Any or all of the following strings are valid values for this attribute. Multiple values are separated by '|' — for example, "locale|navigation|orientation".
这篇关于android更改语言监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!