android更改语言监听器 [英] android change language listener

查看:59
本文介绍了android更改语言监听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

语言可以更改

主页 > 菜单 > 设置 > 区域设置 &文本 > 选择语言环境

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() 方法.

android:configChanges Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and its onConfigurationChanged() method is called.

注意:应避免使用此属性,仅将其用作最后的手段.有关如何正确处理由于配置更改而重新启动的更多信息,请阅读处理运行时更改.

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更改语言监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆